Skip to content

Commit

Permalink
version 1.70
Browse files Browse the repository at this point in the history
  • Loading branch information
Suzie1 committed Jan 15, 2024
1 parent 0ca4afa commit 0c25577
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 9 deletions.
5 changes: 4 additions & 1 deletion Patch_Notes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# 🧩 Comfyroll Studio - Patch Notes

## v1.69 Jan 15, 2024
## v1.70 Jan 15, 2024
- added CR Aspect Ratio Social Media

## v1.69 Jan 14, 2024
- added CR Repeater
- deleted CR Loop List, replaced by CR Repeater
- removed dev nodes
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Co-authored by Suzie1 and RockOfFire

Current version: 1.69
Current version: 1.70

# Wiki

Expand Down Expand Up @@ -40,6 +40,7 @@ __🔳 Aspect Ratio__
* CR SDXL Aspect Ratio
* CR SD1.5 Aspect Ratio
* CR Aspect Ratio Banners (new 18/12/2023)
* CR Aspect Ratio Social Media (new 15/1/2024)

__📜 List Nodes__
* CR Text List (new 19/12/2023)
Expand Down Expand Up @@ -133,8 +134,8 @@ __🌈 Graphics - Pattern__
* CR Radial Gradiant
* CR Starburst Lines
* CR Starburst Colors
* CR Simple Binary Pattern (new 8/12/2023)
* CR Binary Pattern (new 8/12/2023)
* CR Simple Binary Pattern
* CR Binary Pattern

__🟡 Graphics - Pattern__
* CR Draw Shape (new 24/12/2023)
Expand Down Expand Up @@ -246,7 +247,7 @@ __🎲 Utils Random__
* CR Random RGB
* CR Random Multiline Values (updated 28/12/2023)
* CR Random Multiline Colors (new 28/12/2023)
* CR Random RGB Gradient (new 8/12/2023)
* CR Random RGB Gradient
* CR Random Panel Code (new 26/12/2023)

__🔤 Utils Text__
Expand Down
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from .node_mappings import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS

print("------------------------------------------")
print("\033[34mComfyroll Studio v1.69 : \033[92m 170 Nodes Loaded\033[0m")
print("\033[34mComfyroll Studio v1.70 : \033[92m 170 Nodes Loaded\033[0m")
print("------------------------------------------")
print("** For changes, please see patch notes at https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes/blob/main/Patch_Notes.md")
print("** For help, please see the wiki at https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes/wiki")
Expand Down
Binary file added fonts/Caveat-VariableFont_wght.ttf
Binary file not shown.
6 changes: 4 additions & 2 deletions node_mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@
"CR SD1.5 Aspect Ratio": CR_AspectRatioSD15,
"CR SDXL Aspect Ratio": CR_SDXLAspectRatio,
"CR Aspect Ratio": CR_AspectRatio,
"CR Aspect Ratio Banners": CR_AspectRatioBanners,
"CR Aspect Ratio Banners": CR_AspectRatioBanners,
"CR Aspect Ratio Social Media": CR_AspectRatioSocialMedia,
### Legacy Nodes
"CR Image Size": CR_ImageSize,
"CR Aspect Ratio SDXL": CR_AspectRatio_SDXL,
Expand Down Expand Up @@ -316,6 +317,7 @@
"CR SDXL Aspect Ratio": "🔳 CR SDXL Aspect Ratio",
"CR Aspect Ratio": "🔳 CR Aspect Ratio",
"CR Aspect Ratio Banners": "🔳 CR Aspect Ratio Banners",
"CR Aspect Ratio Social Media": "🔳 CR Aspect Ratio Social Media",
### Legacy Nodes
"CR Image Size": "CR Image Size (Legacy)",
"CR Aspect Ratio SDXL": "CR Aspect Ratio SDXL (Legacy)",
Expand Down Expand Up @@ -507,5 +509,5 @@
"CR Text List Simple": "CR Text List Simple (Legacy)",
"CR Image List": "CR Image List (Legacy)",
"CR Image List Simple": "CR Image List Simple (Legacy)",
"CR Input Text List": "CR Input Text List (Legacy)",
"CR Input Text List": "CR Input Text List (Legacy)",
}
76 changes: 75 additions & 1 deletion nodes/nodes_aspect_ratio.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,79 @@ def Aspect_Ratio(self, width, height, aspect_ratio, swap_dimensions, upscale_fac
show_help = "https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes/wiki/Aspect-Ratio-Nodes#cr-aspect-ratio-banners"

return(width, height, upscale_factor, prescale_factor, batch_size, {"samples":latent}, show_help, )

#---------------------------------------------------------------------------------------------------------------------#
class CR_AspectRatioSocialMedia:
def __init__(self):
pass

@classmethod
def INPUT_TYPES(s):

aspect_ratios = ["custom",
"Instagram Landscape - 1080x608",
"Instagram Square - 1080x1080",
"Instagram Portrait - 1080x1350",
"Instagram Stories - 1080x1920",
"Instagram Reels - 1080x1920",
"Facebook Landscape - 1080x1350",
"Facebook Marketplace - 1200x1200",
"Facebook Stories - 1080x1920",
"LinkedIn Background - 1584x396",
"Pinterest Pin Image - 1000x1500"
]

return {
"required": {
"width": ("INT", {"default": 1024, "min": 64, "max": 8192}),
"height": ("INT", {"default": 1024, "min": 64, "max": 8192}),
"aspect_ratio": (aspect_ratios,),
"swap_dimensions": (["Off", "On"],),
"upscale_factor": ("FLOAT", {"default": 1.0, "min": 0.1, "max": 100.0, "step":0.1}),
"prescale_factor": ("FLOAT", {"default": 1.0, "min": 0.1, "max": 100.0, "step":0.1}),
"batch_size": ("INT", {"default": 1, "min": 1, "max": 64})
}
}
RETURN_TYPES = ("INT", "INT", "FLOAT", "FLOAT", "INT", "LATENT", "STRING", )
RETURN_NAMES = ("width", "height", "upscale_factor", "prescale_factor", "batch_size", "empty_latent", "show_help", )
FUNCTION = "Aspect_Ratio"
CATEGORY = icons.get("Comfyroll/Aspect Ratio")

def Aspect_Ratio(self, width, height, aspect_ratio, swap_dimensions, upscale_factor, prescale_factor, batch_size):

# Banner sizes
if aspect_ratio == "Instagram Landscape - 1080x608":
width, height = 1080, 608
elif aspect_ratio == "Instagram Square - 1080x1080":
width, height = 1080, 1080
elif aspect_ratio == "Instagram Portrait - 1080x1350":
width, height = 1080, 1350
elif aspect_ratio == "Instagram Stories - 1080x1920":
width, height = 1080, 1920
elif aspect_ratio == "Instagram Reels - 1080x1920":
width, height = 1080, 1920
elif aspect_ratio == "Facebook Landscape - 1080x1350":
width, height = 1080, 1350
elif aspect_ratio == "Facebook Marketplace - 1200x1200":
width, height = 1200, 1200
elif aspect_ratio == "Facebook Stories - 1080x1920":
width, height = 1080, 1920
elif aspect_ratio == "LinkedIn Background - 1584x396":
width, height = 1584, 396
elif aspect_ratio == "Pinterest Pin Image - 1000x1500":
width, height = 1000, 1500

if swap_dimensions == "On":
width, height = height, width

width = int(width*prescale_factor)
height = int(height*prescale_factor)

latent = torch.zeros([batch_size, 4, height // 8, width // 8])

show_help = "https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes/wiki/Aspect-Ratio-Nodes#cr-aspect-ratio-scial-media"

return(width, height, upscale_factor, prescale_factor, batch_size, {"samples":latent}, show_help, )

#---------------------------------------------------------------------------------------------------------------------#
# MAPPINGS
Expand All @@ -327,7 +400,8 @@ def Aspect_Ratio(self, width, height, aspect_ratio, swap_dimensions, upscale_fac
"CR SD1.5 Aspect Ratio": CR_AspectRatioSD15,
"CR SDXL Aspect Ratio": CR_SDXLAspectRatio,
"CR Aspect Ratio": CR_AspectRatio,
"CR Aspect Ratio Banners":CR_AspectRatioBanners,
"CR Aspect Ratio Banners": CR_AspectRatioBanners,
"CR Aspect Ratio Social Media": CR_AspectRatioSocialMedia,
}
'''

0 comments on commit 0c25577

Please sign in to comment.