3.6 KiB
3.6 KiB
WorkflowConfig
Overview
WorkflowConfig centralises high-level settings (upscale amounts, cropping policy, stitch opacity, seed control, notes) and exposes them both as individual sockets and as a JSON bundle. It supports loading/saving presets, honours server-side random seed generation, and attempts to keep workflow metadata in sync when special seed values are used.
Inputs
Required parameters:
template_name(STRING): Built-in preset to load (currently"Default"). Templates provide fallback values for all outputs.saved_preset(STRING): Filename stem of a saved preset in the workspace (<none>to disable).load_saved_preset(BOOLEAN, defaultFalse): WhenTrue, merges the chosensaved_presetover the template defaults.initial_upscale(FLOAT, default1.0): Upscale factor applied before the main pass.final_upscale(FLOAT, default4.0): Target upscale factor for the final output.tight_crop(BOOLEAN, defaultFalse): Indicates whether downstream nodes should prefer tight subject crops.stitch_bypass_mask(BOOLEAN, defaultFalse): Signals that stitched blends should ignore masks.stitch_opacity(FLOAT, default1.0): Preferred opacity for stitch operations (0–1).crop_fuzz_percent(FLOAT, default5.0): Suggested fuzziness allowance for auto-cropping nodes.crop_pad_px(INT, default0): Additional padding to apply around detected crops.seed(INT, default0): Primary seed value. Special values-1,-2,-3trigger server-side random generation (increment/decrement where possible).job_notes(STRING, default empty): Arbitrary notes stored alongside the configuration.
Optional parameters:
save_preset_as(STRING): Filename stem to use when persisting the current configuration.write_preset(BOOLEAN, defaultFalse): WhenTrue, writessave_preset_asto disk in the preset folder.
Hidden inputs (managed by ComfyUI):
prompt(PROMPT): Used to persist generated seeds back into the executing graph.extra_pnginfo(EXTRA_PNGINFO): Allows embedding the resolved seed into workflow metadata.unique_id(UNIQUE_ID): Required to update workflow widgets when special seeds are consumed.
Outputs
initial_upscale(FLOAT)final_upscale(FLOAT)tight_crop(BOOLEAN)stitch_bypass_mask(BOOLEAN)stitch_opacity(FLOAT)crop_fuzz_percent(FLOAT)crop_pad_px(INT)seed(INT): The resolved seed after handling special values.job_notes(STRING)config_bundle(STRING): JSON string containing all of the above values.
Processing Notes
- Templates and saved presets are merged in order: template defaults → saved preset (if loaded) → current widget values.
- When
seedis-1,-2, or-3, the node generates a random seed server-side. Because the client-side UI cannot receive the update automatically,WorkflowConfigattempts to write the new seed back into both the workflow metadata and the executing prompt using the hidden inputs. - Presets are stored under
ComfyUI/user/default/workflows/workflow_config_presets/relative to the install. Files are JSON-formatted and written only whenwrite_presetis explicitly toggled.
Tips
- Drive other nodes (e.g.,
AutoCropBorders,StitchByMask, custom scripts) using the JSON bundle to keep all config values in sync. - Use
job_notesas a quick logging field—its contents travel alongside the bundle and can be embedded into output metadata downstream. - Save presets for different portrait styles (tight headshots vs. wide environmental shots) and swap them via the dropdown without rearranging your workflow.*** End Patch