2 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
ff375071c0 Fix seed widget displaying actual seed instead of -1
The issue was that serializeValue() was updating the widget's display value to the actual generated seed, causing the UI to show the seed number instead of -1. Now the widget value only updates when the user manually sets a specific seed, keeping -1 visible in the UI for random seeds.

Co-authored-by: jags111 <5968619+jags111@users.noreply.github.com>
2026-02-03 23:03:46 +00:00
copilot-swe-agent[bot]
6e8cb9be98 Initial plan 2026-02-03 22:58:45 +00:00
4 changed files with 6 additions and 68 deletions

21
.gitignore vendored
View File

@@ -1,21 +0,0 @@
# Python cache
__pycache__/
*.py[cod]
*$py.class
*.so
# Virtual environments
venv/
env/
ENV/
# IDE
.vscode/
.idea/
*.swp
*.swo
*~
# OS
.DS_Store
Thumbs.db

View File

@@ -131,17 +131,6 @@ 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>

View File

@@ -4013,34 +4013,6 @@ 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
@@ -4316,7 +4288,6 @@ 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,

View File

@@ -117,7 +117,10 @@ class SeedControl {
this.updateButtonLabel();
}
this.seedWidget.value = this.serializedCtx.seedUsed;
// Don't update the widget value to maintain -1 in the UI when seed was special
if (!this.serializedCtx.wasSpecial) {
this.seedWidget.value = this.serializedCtx.seedUsed;
}
if (this.serializedCtx.wasSpecial) {
this.lastSeed = this.serializedCtx.seedUsed;
@@ -133,12 +136,8 @@ class SeedControl {
return; // Exit the function immediately
}
if (this.serializedCtx.wasSpecial) {
this.seedWidget.value = -1;
}
// Check if seed has changed to a non -1 value, and if so, update lastSeed
if (this.seedWidget.value !== -1) {
// Update lastSeed if user manually changed the seed to a specific value
if (!this.serializedCtx.wasSpecial && this.seedWidget.value !== -1) {
this.lastSeed = this.seedWidget.value;
}