Skip to content

Add New Seed Node (CORE-295)#14544

Open
yousef-rafat wants to merge 10 commits into
Comfy-Org:masterfrom
yousef-rafat:feature/global-seed-node
Open

Add New Seed Node (CORE-295)#14544
yousef-rafat wants to merge 10 commits into
Comfy-Org:masterfrom
yousef-rafat:feature/global-seed-node

Conversation

@yousef-rafat

Copy link
Copy Markdown
Contributor

Adds a new seed node with a global and a local modes
Global Option will overwrite all the nodes with "seed" in them. Local Option will only overwrite nodes connected directly from the sockets.
The Seed node has two modes: "overwrite all" and "placeholders only". Placeholder-only will only overwrite seeds with 0 as their value. Overwrite all will overwrite all seed inputs across the workflow.

The screenshot shows deterministic outputs with "randomize value" as the chosen option for the ksampler.

image

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 918d1730-8b4c-47d4-a375-dc13495bd839

📥 Commits

Reviewing files that changed from the base of the PR and between 5fcab49 and ca64a3b.

📒 Files selected for processing (1)
  • comfy_extras/nodes_seed.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • comfy_extras/nodes_seed.py

📝 Walkthrough

Walkthrough

A new file comfy_extras/nodes_seed.py is added, implementing a GlobalSeedNode ComfyUI extension. It provides two helper functions for building an undirected node connectivity graph from wired inputs and performing BFS over it. An _on_prompt hook scans incoming workflows for GlobalSeedNode instances, resolves a master seed, determines affected nodes (all or only graph-connected ones), and writes the master seed to static seed inputs according to a chosen mode (placeholders only or overwrite all). The GlobalSeedNode schema defines seed, mode, and global inputs and uses time.time() for fingerprinting. SeedExtension registers the hook and exposes the node; comfy_entrypoint() returns the extension. nodes.py registers the new file in init_builtin_extra_nodes().

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically identifies the main change: addition of a new seed node with reference to the tracking issue (CORE-295).
Description check ✅ Passed The description is directly related to the changeset, explaining the new seed node's modes and functionality with visual demonstration of usage in a workflow.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@comfy_extras/nodes_seed.py`:
- Around line 53-56: The numeric conversion of seed using int(inputs.get("seed",
0)) on line 53 executes before the wire check on line 56, causing a failure if
seed is wired as a list. Move the wire check logic (is_wired =
isinstance(inputs.get("seed"), list)) before the int conversion, and
conditionally convert master to int only when is_wired is False to prevent the
type conversion error when seed is a wired input.
- Around line 49-76: The `processed` set is incorrectly marking nodes as
processed even when no seed update actually occurs. Move the
`processed.add(tid)` statement (currently at the end of the loop, outside the
conditional check) to only execute inside the conditional block where the seed
is actually written (after the line `node_inputs["seed"] = master`). This
ensures nodes are only marked as processed when they actually receive a seed
value update, allowing later GlobalSeed nodes with overwrite all mode to still
update nodes that were skipped by earlier nodes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: d3776e48-7be9-458e-ab44-f65a08b06c9b

📥 Commits

Reviewing files that changed from the base of the PR and between 16514da and 6f8b2e4.

📒 Files selected for processing (2)
  • comfy_extras/nodes_seed.py
  • nodes.py

Comment thread comfy_extras/nodes_seed.py
Comment thread comfy_extras/nodes_seed.py Outdated
@yousef-rafat yousef-rafat force-pushed the feature/global-seed-node branch from 065975a to 1e525fa Compare June 18, 2026 19:32

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@comfy_extras/nodes_seed.py`:
- Around line 57-61: The guard condition at line 58 only skips when both
is_wired and is_global are true, but the actual issue occurs whenever is_wired
is true regardless of global mode. When is_wired is true but is_global is false,
the code continues past the guard and attempts int(master) on line 63 where
master is still a list (e.g., ["node_id", 0]), causing a TypeError. Change the
condition from "if is_wired and is_global:" to "if is_wired:" so that the
continue statement executes for all cases where the seed input is wired,
preventing the downstream int(master) call from receiving a list value.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 0968d002-1545-4c9d-9cb0-b07025f296e5

📥 Commits

Reviewing files that changed from the base of the PR and between 53354b1 and 5fcab49.

📒 Files selected for processing (1)
  • comfy_extras/nodes_seed.py

Comment thread comfy_extras/nodes_seed.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants