mirror of
https://github.com/jags111/efficiency-nodes-comfyui.git
synced 2026-05-07 09:06:44 -03:00
Compare commits
5 Commits
copilot/fi
...
copilot/ad
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
946fca3e18 | ||
|
|
3b2a5a36ad | ||
|
|
73d807aa40 | ||
|
|
b80d754d1f | ||
|
|
a075f2b7f9 |
22
.gitignore
vendored
22
.gitignore
vendored
@@ -4,30 +4,12 @@ __pycache__/
|
|||||||
*$py.class
|
*$py.class
|
||||||
*.so
|
*.so
|
||||||
|
|
||||||
# Distribution / packaging
|
|
||||||
.Python
|
|
||||||
build/
|
|
||||||
develop-eggs/
|
|
||||||
dist/
|
|
||||||
downloads/
|
|
||||||
eggs/
|
|
||||||
.eggs/
|
|
||||||
lib/
|
|
||||||
lib64/
|
|
||||||
parts/
|
|
||||||
sdist/
|
|
||||||
var/
|
|
||||||
wheels/
|
|
||||||
*.egg-info/
|
|
||||||
.installed.cfg
|
|
||||||
*.egg
|
|
||||||
|
|
||||||
# Virtual environments
|
# Virtual environments
|
||||||
venv/
|
venv/
|
||||||
ENV/
|
|
||||||
env/
|
env/
|
||||||
|
ENV/
|
||||||
|
|
||||||
# IDEs
|
# IDE
|
||||||
.vscode/
|
.vscode/
|
||||||
.idea/
|
.idea/
|
||||||
*.swp
|
*.swp
|
||||||
|
|||||||
11
README.md
11
README.md
@@ -131,6 +131,17 @@ Please check out our WIKI for any use cases and new developments including workf
|
|||||||
<img src="https://github.com/LucianoCirino/efficiency-nodes-media/blob/main/images/nodes/Image%20Overlay%20-%20Node%20Example.png" width="1080">
|
<img src="https://github.com/LucianoCirino/efficiency-nodes-media/blob/main/images/nodes/Image%20Overlay%20-%20Node%20Example.png" width="1080">
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
</details>
|
||||||
|
<!-------------------------------------------------------------------------------------------------------------------------------------------------------->
|
||||||
|
<details>
|
||||||
|
<summary><b>Live Preview (Eff.)</b></summary>
|
||||||
|
<ul>
|
||||||
|
<li>Node that displays a live preview of images while allowing them to pass through to other nodes in the workflow.</li>
|
||||||
|
<li>Can be connected to multiple samplers sequentially to show progressive updates as the workflow advances through different stages (base sampling, refining, hi-res fix, detailing, etc.).</li>
|
||||||
|
<li>Useful for placing preview displays outside of subgraphs or in custom locations within complex workflows.</li>
|
||||||
|
<li>Simply connect the IMAGE output from any sampler or image processing node to this node's input, and connect its output to continue the workflow.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
<!-------------------------------------------------------------------------------------------------------------------------------------------------------->
|
<!-------------------------------------------------------------------------------------------------------------------------------------------------------->
|
||||||
<details>
|
<details>
|
||||||
|
|||||||
@@ -99,16 +99,6 @@ def encode_prompts(positive_prompt, negative_prompt, token_normalization, weight
|
|||||||
elif return_type == "both":
|
elif return_type == "both":
|
||||||
return positive_encoded, negative_encoded, clip, refiner_positive_encoded, refiner_negative_encoded, refiner_clip
|
return positive_encoded, negative_encoded, clip, refiner_positive_encoded, refiner_negative_encoded, refiner_clip
|
||||||
|
|
||||||
########################################################################################################################
|
|
||||||
# Helper function for VAE error message
|
|
||||||
def get_missing_vae_error(ckpt_name):
|
|
||||||
"""Generate error message for checkpoints without embedded VAE"""
|
|
||||||
return (
|
|
||||||
f"Checkpoint '{ckpt_name}' does not contain an embedded VAE. "
|
|
||||||
f"This checkpoint (likely an AIO model) requires an external VAE. "
|
|
||||||
f"Please select a VAE file instead of 'Baked VAE'."
|
|
||||||
)
|
|
||||||
|
|
||||||
########################################################################################################################
|
########################################################################################################################
|
||||||
# TSC Efficient Loader
|
# TSC Efficient Loader
|
||||||
class TSC_EfficientLoader:
|
class TSC_EfficientLoader:
|
||||||
@@ -176,9 +166,6 @@ class TSC_EfficientLoader:
|
|||||||
f"{warning('Efficiency Nodes:')} Baked VAE not found in cache, loading checkpoint to extract VAE...")
|
f"{warning('Efficiency Nodes:')} Baked VAE not found in cache, loading checkpoint to extract VAE...")
|
||||||
_, _, vae = load_checkpoint(ckpt_name, my_unique_id, output_vae=True, cache=ckpt_cache,
|
_, _, vae = load_checkpoint(ckpt_name, my_unique_id, output_vae=True, cache=ckpt_cache,
|
||||||
cache_overwrite=True)
|
cache_overwrite=True)
|
||||||
# Check if VAE extraction was successful
|
|
||||||
if vae is None:
|
|
||||||
raise ValueError(get_missing_vae_error(ckpt_name))
|
|
||||||
else:
|
else:
|
||||||
model, clip, vae = load_checkpoint(ckpt_name, my_unique_id, cache=ckpt_cache, cache_overwrite=True)
|
model, clip, vae = load_checkpoint(ckpt_name, my_unique_id, cache=ckpt_cache, cache_overwrite=True)
|
||||||
lora_params = None
|
lora_params = None
|
||||||
@@ -208,9 +195,6 @@ class TSC_EfficientLoader:
|
|||||||
# Check for custom VAE
|
# Check for custom VAE
|
||||||
if vae_name != "Baked VAE":
|
if vae_name != "Baked VAE":
|
||||||
vae = load_vae(vae_name, my_unique_id, cache=vae_cache, cache_overwrite=True)
|
vae = load_vae(vae_name, my_unique_id, cache=vae_cache, cache_overwrite=True)
|
||||||
elif vae is None:
|
|
||||||
# If "Baked VAE" was selected but checkpoint has no embedded VAE
|
|
||||||
raise ValueError(get_missing_vae_error(ckpt_name))
|
|
||||||
|
|
||||||
# Data for XY Plot
|
# Data for XY Plot
|
||||||
dependencies = (vae_name, ckpt_name, clip, clip_skip, refiner_name, refiner_clip, refiner_clip_skip,
|
dependencies = (vae_name, ckpt_name, clip, clip_skip, refiner_name, refiner_clip, refiner_clip_skip,
|
||||||
@@ -4029,6 +4013,34 @@ class TSC_ImageOverlay:
|
|||||||
# Return the edited base image
|
# Return the edited base image
|
||||||
return (base_image,)
|
return (base_image,)
|
||||||
|
|
||||||
|
########################################################################################################################
|
||||||
|
# TSC Live Preview Node
|
||||||
|
class TSC_LivePreview:
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def INPUT_TYPES(cls):
|
||||||
|
return {
|
||||||
|
"required": {
|
||||||
|
"images": ("IMAGE",),
|
||||||
|
},
|
||||||
|
"hidden": {
|
||||||
|
"prompt": "PROMPT",
|
||||||
|
"extra_pnginfo": "EXTRA_PNGINFO"
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
RETURN_TYPES = ("IMAGE",)
|
||||||
|
FUNCTION = "preview_image"
|
||||||
|
OUTPUT_NODE = True
|
||||||
|
CATEGORY = "Efficiency Nodes/Image"
|
||||||
|
|
||||||
|
def preview_image(self, images, prompt=None, extra_pnginfo=None):
|
||||||
|
# Generate preview using ComfyUI's PreviewImage node
|
||||||
|
preview = PreviewImage().save_images(images, prompt=prompt, extra_pnginfo=extra_pnginfo)["ui"]
|
||||||
|
|
||||||
|
# Return both the preview for UI and the original images for pass-through
|
||||||
|
return {"ui": preview, "result": (images,)}
|
||||||
|
|
||||||
########################################################################################################################
|
########################################################################################################################
|
||||||
# Noise Sources & Seed Variations
|
# Noise Sources & Seed Variations
|
||||||
# https://github.com/shiimizu/ComfyUI_smZNodes
|
# https://github.com/shiimizu/ComfyUI_smZNodes
|
||||||
@@ -4304,6 +4316,7 @@ NODE_CLASS_MAPPINGS = {
|
|||||||
"Manual XY Entry Info": TSC_XYplot_Manual_XY_Entry_Info,
|
"Manual XY Entry Info": TSC_XYplot_Manual_XY_Entry_Info,
|
||||||
"Join XY Inputs of Same Type": TSC_XYplot_JoinInputs,
|
"Join XY Inputs of Same Type": TSC_XYplot_JoinInputs,
|
||||||
"Image Overlay": TSC_ImageOverlay,
|
"Image Overlay": TSC_ImageOverlay,
|
||||||
|
"Live Preview (Eff.)": TSC_LivePreview,
|
||||||
"Noise Control Script": TSC_Noise_Control_Script,
|
"Noise Control Script": TSC_Noise_Control_Script,
|
||||||
"HighRes-Fix Script": TSC_HighRes_Fix,
|
"HighRes-Fix Script": TSC_HighRes_Fix,
|
||||||
"Tiled Upscaler Script": TSC_Tiled_Upscaler,
|
"Tiled Upscaler Script": TSC_Tiled_Upscaler,
|
||||||
|
|||||||
Reference in New Issue
Block a user