version 1.76

This commit is contained in:
Suzie1
2024-01-24 22:44:09 +00:00
parent efcdf631d1
commit d78b780ae4
6 changed files with 124 additions and 33 deletions
+5
View File
@@ -1,5 +1,10 @@
# 🧩 Comfyroll Studio - Patch Notes
## v1.76 Jan 24, 2024
- added CR VAE Decode
- added CR Combine Prompt
- added CR Diamond Pattern
## v1.75.1 Jan 24, 2024
- fix for issue 112 CR Text Blacklist, added handling for blank lines and fixed issue with finding multiple keywords
- PR108, fix for missing import in nodes_utils_text.py
+6 -3
View File
@@ -2,7 +2,7 @@
Co-authored by Suzie1 and RockOfFire
Current version: 1.75
Current version: 1.76
# Wiki
@@ -31,9 +31,11 @@ __📦 Essential Nodes__
* CR Image Output (changed 18/12/2023)
* CR Latent Batch Size
* CR Prompt Text
* CR Combine Prompt
* CR Seed
* CR Conditioning Mixer
* CR Select Model
* CR Select Model (new 24/1/2024)
* CR VAE Decode (new 24/1/2024)
__🔳 Aspect Ratio__
* CR Aspect Ratio
@@ -167,7 +169,8 @@ __🌁 Graphics - Layout__
* CR Feathered Border (new 21/12/2023)
* CR Color Panel
* CR Simple Text Panel
* CR Half Drop Panel
* CR Half Drop Panel (new 23/1/2024)
* CR Diamond Panel (new 24/1/2024)
* CR Overlay Transparent Image
* CR Select ISO Size (new 18/1/2023)
+1 -1
View File
@@ -21,7 +21,7 @@
from .node_mappings import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
print("------------------------------------------")
print("\033[34mComfyroll Studio v1.75 : \033[92m 175 Nodes Loaded\033[0m")
print("\033[34mComfyroll Studio v1.76 : \033[92m 175 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")
+9 -5
View File
@@ -52,8 +52,9 @@ NODE_CLASS_MAPPINGS = {
"CR Conditioning Mixer": CR_ConditioningMixer,
"CR Select Model": CR_SelectModel,
"CR Seed": CR_Seed,
"CR Prompt Text": CR_PromptText,
#"CR VAE Decode": CR_VAEDecode,
"CR Prompt Text": CR_PromptText,
"CR Combine Prompt": CR_CombinePrompt,
"CR VAE Decode": CR_VAEDecode,
### List Nodes
"CR Text List": CR_TextList,
"CR Prompt List": CR_PromptList,
@@ -164,7 +165,8 @@ NODE_CLASS_MAPPINGS = {
"CR Simple Text Panel": CR_SimpleTextPanel,
"CR Color Panel": CR_ColorPanel,
"CR Overlay Transparent Image": CR_OverlayTransparentImage,
"CR Half Drop Panel": CR_HalfDropPanel,
"CR Half Drop Panel": CR_HalfDropPanel,
"CR Diamond Panel": CR_DiamondPanel,
#"CR Simple Titles": CR_SimpleTitles,
### Graphics Template
"CR Simple Meme Template": CR_SimpleMemeTemplate,
@@ -297,7 +299,8 @@ NODE_DISPLAY_NAME_MAPPINGS = {
"CR Conditioning Mixer": "⚙️ CR Conditioning Mixer",
"CR Select Model": "🔮 CR Select Model",
"CR Prompt Text": "⚙️ CR Prompt Text",
#"CR VAE Decode": "⚙️ CR VAE Decode",
"CR Combine Prompt": "⚙️ CR Combine Prompt",
"CR VAE Decode": "⚙️ CR VAE Decode",
### List Nodes
"CR Text List": "📜 CR Text List",
"CR Prompt List": "📜 CR Prompt List",
@@ -403,7 +406,8 @@ NODE_DISPLAY_NAME_MAPPINGS = {
"CR Image Grid Panel": "🌁 CR Image Grid Panel",
"CR Simple Text Panel": "🌁 CR Simple Text Panel",
"CR Color Panel": "🌁 CR Color Panel",
"CR Half Drop Panel": "🌁 CR Half Drop Panel",
"CR Half Drop Panel": "🌁 CR Half Drop Panel",
"CR Diamond Panel": "🌁 CR Diamond Panel",
"CR Page Layout": "🌁 CR Page Layout",
"CR Image Border": "🌁 CR Image Border",
"CR Feathered Border": "🌁 CR Feathered Border",
+49 -11
View File
@@ -205,7 +205,10 @@ class CR_PromptText:
@classmethod
def INPUT_TYPES(s):
return {"required": {"prompt": ("STRING", {"default": "prompt", "multiline": True})}}
return {"required": {
"prompt": ("STRING", {"default": "prompt", "multiline": True})
}
}
RETURN_TYPES = ("STRING", "STRING", )
RETURN_NAMES = ("prompt", "show_help", )
@@ -213,9 +216,40 @@ class CR_PromptText:
CATEGORY = icons.get("Comfyroll/Essential/Core")
def get_value(self, prompt):
show_help = "https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes/wiki/Core-Nodes#cr-prompt-text"
return (prompt, show_help, )
#---------------------------------------------------------------------------------------------------------------------#
class CR_CombinePrompt:
@classmethod
def INPUT_TYPES(s):
return {"required": {
},
"optional": {
"part1": ("STRING", {"default": "", "multiline": True}),
"part2": ("STRING", {"default": "", "multiline": True}),
"part3": ("STRING", {"default": "", "multiline": True}),
"part4": ("STRING", {"default": "", "multiline": True}),
"separator": ("STRING", {"default": ",", "multiline": False}),
}
}
RETURN_TYPES = ("STRING", "STRING", )
RETURN_NAMES = ("prompt", "show_help", )
FUNCTION = "get_value"
CATEGORY = icons.get("Comfyroll/Essential/Core")
def get_value(self, part1="", part2="", part3="", part4="", separator=""):
show_help = "https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes/wiki/Core-Nodes#cr-prompt-parts"
prompt = part1 + separator + part2 + separator + part3 + separator + part4
return (prompt, show_help, )
#---------------------------------------------------------------------------------------------------------------------#
class CR_ConditioningMixer:
@@ -350,12 +384,11 @@ class CR_VAEDecode:
@classmethod
def INPUT_TYPES(s):
padding_modes = ["zeros", "replicate", "circular"]
return {"required": {
"samples": ("LATENT", ),
"vae": ("VAE", ),
"padding_mode": (padding_modes,),
"tiled": ("BOOLEAN", {"default": False}),
"circular": ("BOOLEAN", {"default": False}),
}
}
RETURN_TYPES = ("IMAGE", "STRING", )
@@ -363,14 +396,18 @@ class CR_VAEDecode:
FUNCTION = "vae_decode"
CATEGORY = icons.get("Comfyroll/Essential/Core")
def vae_decode(self, samples, vae, padding_mode):
def vae_decode(self, samples, vae, circular=False, tiled=False):
show_help = "https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes/wiki/Core-Nodes#cr-vae-decode"
for layer in [layer for layer in vae.first_stage_model.modules() if isinstance(layer, torch.nn.Conv2d)]:
layer.padding_mode = padding_mode
c = vae.decode(samples["samples"])
if circular == True:
for layer in [layer for layer in vae.first_stage_model.modules() if isinstance(layer, torch.nn.Conv2d)]:
layer.padding_mode = "circular"
if tiled == True:
c = vae.decode_tiled(samples["samples"], tile_x=512, tile_y=512, )
else:
c = vae.decode(samples["samples"])
return (c, show_help, )
@@ -385,9 +422,10 @@ NODE_CLASS_MAPPINGS = {
"CR Latent Batch Size": CR_LatentBatchSize,
"CR Seed": CR_Seed,
"CR Prompt Text": CR_PromptText,
"CR Combine Prompt": CR_CombinePrompt,
"CR Conditioning Mixer": CR_ConditioningMixer,
"CR Select Model": CR_SelectModel,
#"CR VAE Decode": CR_VAEDecode,
"CR VAE Decode": CR_VAEDecode,
}
'''
+54 -13
View File
@@ -616,7 +616,7 @@ class CR_HalfDropPanel:
@classmethod
def INPUT_TYPES(s):
patterns = ["none", "half drop", "quarter drop", "diamond", "custom drop %"]
patterns = ["none", "half drop", "quarter drop", "custom drop %"]
return {"required": {
"image": ("IMAGE",),
@@ -660,8 +660,55 @@ class CR_HalfDropPanel:
panel_image.paste(pil_img, (0, y))
panel_image.paste(pil_img, (x, -3*y//4))
panel_image.paste(pil_img, (x, y//4))
panel_image.paste(pil_img, (x, 5*y//4))
elif pattern == "diamond":
panel_image.paste(pil_img, (x, 5*y//4))
elif pattern == "custom drop %":
panel_image.paste(pil_img, (0, 0))
panel_image.paste(pil_img, (0, y))
panel_image.paste(pil_img, (x, (d-100)*y//100))
panel_image.paste(pil_img, (x, d*y//100))
panel_image.paste(pil_img, (x, y + d*y//100))
image_out = pil2tensor(panel_image.convert('RGB'))
return (image_out, show_help, )
#---------------------------------------------------------------------------------------------------------------------#
class CR_DiamondPanel:
@classmethod
def INPUT_TYPES(s):
patterns = ["none", "diamond"]
return {"required": {
"image": ("IMAGE",),
"pattern": (patterns,),
}
}
RETURN_TYPES = ("IMAGE", "STRING", )
RETURN_NAMES = ("image", "show_help", )
FUNCTION = "make_panel"
CATEGORY = icons.get("Comfyroll/Graphics/Layout")
def make_panel(self, image, pattern, drop_percentage=0.5):
show_help = "https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes/wiki/Layout-Nodes#cr-diamond-panel"
if pattern == "none":
return (image, show_help, )
# Convert to PIL image
pil_img = tensor2pil(image)
pil_img = pil_img.convert('RGBA')
x, y = pil_img.size
aspect_ratio = x / y
d = int(drop_percentage * 100)
panel_image = Image.new('RGBA', (x*2, y*2))
if pattern == "diamond":
diamond_size = min(x, y)
diamond_width = min(x, y * aspect_ratio)
@@ -693,19 +740,12 @@ class CR_HalfDropPanel:
panel_image.paste(diamond_image, (x, y), diamond_image)
panel_image.paste(diamond_image, (3*x//2, (d-100)*y//100), diamond_image)
panel_image.paste(diamond_image, (3*x//2, d*y//100), diamond_image)
panel_image.paste(diamond_image, (3*x//2, y + d*y//100), diamond_image)
elif pattern == "custom drop %":
panel_image.paste(pil_img, (0, 0))
panel_image.paste(pil_img, (0, y))
panel_image.paste(pil_img, (x, (d-100)*y//100))
panel_image.paste(pil_img, (x, d*y//100))
panel_image.paste(pil_img, (x, y + d*y//100))
panel_image.paste(diamond_image, (3*x//2, y + d*y//100), diamond_image)
image_out = pil2tensor(panel_image.convert('RGB'))
return (image_out, show_help, )
return (image_out, show_help, )
#---------------------------------------------------------------------------------------------------------------------#
class CR_SelectISOSize:
@@ -745,6 +785,7 @@ NODE_CLASS_MAPPINGS = {
"CR Page Layout": CR_PageLayout,
"CR Image Grid Panel": CR_ImageGridPanel,
"CR Half Drop Panel": CR_HalfDropPanel,
"CR Diamond Panel": CR_DiamondPanel,
"CR Image Border": CR_ImageBorder,
"CR Feathered Border": CR_FeatheredBorder,
"CR Color Panel": CR_ColorPanel,