Nodes/PortraitUtils/Seed from Config
ComfyUI Node

Seed from Config

One seed for the whole run, and no dice button on it

By heyburns·Created about a year ago·Updated 23 days ago· 3
Seed from Config
  • finish_config
  • seed

What it's for

PortraitUtils wants one seed for the run, stored in the Finish & Run Config bundle along with the upscale factors and the auto-correction switches. Samplers take INT. So this reader is the bridge: bundle in, integer out.

There are no widgets and nothing to decide. That's the point - it's the smallest possible unit of "the value lives in the config, the sampler gets a number."

Inputs and outputs

Required: finish_config (PORTRAIT_FINISH_CONFIG_V2). Output: seed (INT). The config's seed range is 0 to 4294967295, which sits comfortably inside what every sampler expects.

Why you'd want it

Two reasons, and they're both about not maintaining the same number in five places.

Consistency across a multi-pass chain. If your edit stage and your detail pass need to agree - or you want a whole stable of runs where only one variable changes - one authoritative seed is how you get it. Wire one reader into each sampler and they can't drift apart.

Reproducibility that survives a reload. The value lives in a node you can see, next to the upscale factors and the flip switch, rather than typed into whichever sampler widget you happened to touch last.

Finish & Run Config ──> Seed from Config ── INT ──> sampler 1
                                            └─────> sampler 2 (same seed, deliberately)

The bit that surprises people

There is no dice button. The seed lives in a bundle, so it isn't a widget with ComfyUI's control_after_generate behaviour, and nothing randomises it between queue runs. Every queue with that config produces the same seed - which is either exactly what you wanted or a bug report waiting to happen.

If you do want a different seed per run, don't fight it: use ComfyUI's own seed node (or any random-seed node) inline on the sampler and leave this reader for the fixed-seed cases. And while you're in there, check your global "widget control mode" setting. ComfyUI's default generates the next seed after the current value has already been sent, so the number in the box isn't the number that ran - the single most common seed confusion in the ecosystem, and it bites everyone exactly once. Switch it to Before and it stops happening.

It's also worth knowing what a shared seed does and doesn't buy you. Same seed, same sampler settings, same model: reproducible. Same seed with a different prompt, a different denoise or a re-encoded image: not reproducible, and you can spend an hour proving that to yourself the hard way.

Where people get burned

Trying to connect finish_config straight into a sampler's seed socket. Won't take. A sampler's seed input is INT; the bundle is PORTRAIT_FINISH_CONFIG_V2. Some people work around this by converting the sampler's seed widget to an input and then converting the configuration node's output - that doesn't work either. The reader is the mechanism.

Second: if the value doesn't change when you change the config, check whether anything is even connected upstream. An unconnected optional input reads as absent, and the sampler silently falls back to its own widget.

Third, and specific to this suite: an old 1.x workflow's equivalent reader doesn't exist any more. The universal project config and its generic extractors were retired in 2.0 in favour of these stage-scoped bundles and readers, and there's no compatibility alias - rebuild rather than patch.

  • Scale from Config - initial_upscale or final_upscale as a FLOAT.
  • Crop Prompt from Config - subject_mask as a STRING.
  • Edit Prompt from Config - one of the four edit/stitch prompts.
  • Outpaint Prompt from Config - the outpainting prompt.
  • Save Info from Source - filename and output directory from the loader's source bundle.

Install

Part of PortraitUtils. ComfyUI Manager → search PortraitUtils (publisher heyburns, GPLv3), or:

cd ComfyUI/custom_nodes
git clone https://github.com/heyburns/PortraitUtils
/path/to/ComfyUI/venv/bin/python -m pip install -r PortraitUtils/requirements.txt

Use ComfyUI's own Python interpreter. The pack installs numpy, Pillow>=9.1, opencv-python-headless>=4.10.0.84 and tifffile, and you should have exactly one OpenCV wheel variant in that environment. Restart the ComfyUI server after installing - refreshing the browser won't reload Python node definitions.

CategoryPortraitUtils/Config V2/Readers

Inputs (1)

NameTypeDefaultDescription
finish_configPORTRAIT_FINISH_CONFIG_V2—

Outputs (1)

NameTypeDescription
seedINT—