mirror of
https://github.com/jags111/efficiency-nodes-comfyui.git
synced 2026-05-07 01:06:42 -03:00
Compare commits
5 Commits
copilot/fi
...
copilot/ad
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
946fca3e18 | ||
|
|
3b2a5a36ad | ||
|
|
73d807aa40 | ||
|
|
b80d754d1f | ||
|
|
a075f2b7f9 |
21
.gitignore
vendored
Normal file
21
.gitignore
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
# Python cache
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
*.so
|
||||
|
||||
# Virtual environments
|
||||
venv/
|
||||
env/
|
||||
ENV/
|
||||
|
||||
# IDE
|
||||
.vscode/
|
||||
.idea/
|
||||
*.swp
|
||||
*.swo
|
||||
*~
|
||||
|
||||
# OS
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
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">
|
||||
</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>
|
||||
|
||||
@@ -4013,6 +4013,34 @@ class TSC_ImageOverlay:
|
||||
# Return the edited 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
|
||||
# https://github.com/shiimizu/ComfyUI_smZNodes
|
||||
@@ -4288,6 +4316,7 @@ NODE_CLASS_MAPPINGS = {
|
||||
"Manual XY Entry Info": TSC_XYplot_Manual_XY_Entry_Info,
|
||||
"Join XY Inputs of Same Type": TSC_XYplot_JoinInputs,
|
||||
"Image Overlay": TSC_ImageOverlay,
|
||||
"Live Preview (Eff.)": TSC_LivePreview,
|
||||
"Noise Control Script": TSC_Noise_Control_Script,
|
||||
"HighRes-Fix Script": TSC_HighRes_Fix,
|
||||
"Tiled Upscaler Script": TSC_Tiled_Upscaler,
|
||||
|
||||
@@ -36,6 +36,7 @@ function toggleWidget(node, widget, show = false, suffix = "") {
|
||||
node.setSize([node.size[0], newHeight]);
|
||||
}
|
||||
|
||||
const WIDGET_HEIGHT = 24;
|
||||
// Use for Multiline Widget Nodes (aka Efficient Loaders)
|
||||
function toggleWidget_2(node, widget, show = false, suffix = "") {
|
||||
if (!widget || doesInputWithNameExist(node, widget.name)) return;
|
||||
@@ -51,10 +52,8 @@ function toggleWidget_2(node, widget, show = false, suffix = "") {
|
||||
widget.computeSize = show ? origProps[widget.name].origComputeSize : () => [0, -4];
|
||||
|
||||
if (initialized){
|
||||
// Calculate the new height for the node based on its computeSize method
|
||||
// This properly accounts for font size changes and ensures widgets don't overlap
|
||||
const newHeight = node.computeSize()[1];
|
||||
node.setSize([node.size[0], newHeight]);
|
||||
const adjustment = show ? WIDGET_HEIGHT : -WIDGET_HEIGHT;
|
||||
node.setSize([node.size[0], node.size[1] + adjustment]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user