Nodes/4A Prompt Manager/Double Sample Parameters
ComfyUI Node

Double Sample Parameters

Set your second sampling pass once — and let the recipe travel with the image

By tsukino4a·Created 2 months ago·Updated 15 days ago· 24
Double Sample Parameters
    • seed
    • steps
    • cfg
    • sampler
    • scheduler
    • denoise
    • parameters_json
    seed0
    steps20
    cfg7.0
    sampler
    scheduler
    denoise1.00

    Two-pass sampling is one of the highest-value habits in ComfyUI: sample once at low resolution to compose the image, then run a second pass on a cleaned-up latent (or a higher resolution) to add detail. The standard way is to build that second KSampler with hand-placed widgets. This node is the tidy version - a dedicated home for the second pass's sampler settings that also hands you a portable JSON string so the whole recipe can be saved into the image's metadata and reused later.

    What it is, in context

    It's the sibling of Input Parameters, which does the same job for the first pass. Together they give a double-sampler workflow a single, inspectable place where every generation setting lives: first-pass values from Input Parameters, second-pass values from this node. The README's quick start walks exactly this - 02_double_sampler_workflow wires Input Parameters → KSampler → second KSampler fed by Double Sample Parameters, with the Bypass Switch controlling whether that second pass runs at all.

    Inputs that matter

    The six you'd expect for a KSampler's second pass:

    • seed (INT) - defaults to 0, with control_after_generate enabled so it randomizes after each run like a core seed widget.
    • steps (INT, default 20), cfg (FLOAT, default 7.0), denoise (FLOAT, default 1.0) - the usual suspects. For a hires-fix-style second pass you'll often lower denoise well below 1.0.
    • sampler - the full 44-entry ComfyUI sampler list, including the CFG++ (_cfg_pp) and SDE variants.
    • scheduler - the 9 standard schedulers (karras, exponential, ddim_uniform, and friends).

    One genuinely nice detail: the sampler and scheduler lists aren't frozen at load time. The node rebuilds them lazily from comfy.samplers.KSampler on access, so if another pack adds a sampler (like RES4LYF's beta samplers), the dropdown and output type stay in sync instead of giving you a "Return type mismatch" error.

    Outputs

    Six typed wires (seed, steps, cfg, sampler, scheduler, denoise) that plug straight into a KSampler's inputs, plus one star:

    • parameters_json (STRING) - a compact, self-identifying JSON payload tagged with schema pm4a_double_sample_parameters. The point of the tag: you can concatenate it with Input Parameters' parameters_json and feed the combined string into the pack's Image Saver, which picks each schema out of the blob and writes the correct values into the A1111-style metadata. That's how a second-pass recipe survives inside the PNG instead of dying with the workflow.

    Installing it

    Ships with the pack - install once, get all eight nodes:

    cd ComfyUI/custom_nodes
    git clone https://github.com/tsukino4a/ComfyUI-4A-Prompt-Manager.git
    cd ComfyUI-4A-Prompt-Manager
    python install.py   # or: pip install -r requirements.txt
    

    Restart ComfyUI after. Or use ComfyUI Manager and search 4A Prompt Manager. The only extra Python dependency in the pack is piexif, and that's only needed by Image Saver for JPEG/WebP - this node runs with zero extra setup.

    Troubleshooting

    • Wire the named outputs, not the JSON. parameters_json is for the Image Saver's metadata slot, not for KSampler. KSampler wants the individual seed, steps, cfg wires.
    • "Return type mismatch" after installing another sampler pack. If you see this on the sampler wire, refresh/restart - the lazy type rebuild usually fixes it on the next load.
    • Second pass runs but does nothing. Check the Bypass Switch in the workflow - by default this pack's second-pass subgraph starts bypassed until something enables it.
    Category4A-Prompt-Manager

    Inputs (6)

    NameTypeDefaultDescription
    seedINT00–18446744073709550000
    stepsINT201–10000
    cfgFLOAT7.00–100
    samplerCOMBO44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38
    schedulerCOMBO9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3
    denoiseFLOAT1.000–1

    Outputs (7)

    NameTypeDescription
    seedINT
    stepsINT
    cfgFLOAT
    samplereuler,euler_cfg_pp,euler_ancestral,euler_ancestral_cfg_pp,heun,heunpp2,exp_heun_2_x0,exp_heun_2_x0_sde,dpm_2,dpm_2_ancestral,lms,dpm_fast,dpm_adaptive,dpmpp_2s_ancestral,dpmpp_2s_ancestral_cfg_pp,dpmpp_sde,dpmpp_sde_gpu,dpmpp_2m,dpmpp_2m_cfg_pp,dpmpp_2m_sde,dpmpp_2m_sde_gpu,dpmpp_2m_sde_heun,dpmpp_2m_sde_heun_gpu,dpmpp_3m_sde,dpmpp_3m_sde_gpu,ddpm,lcm,ipndm,ipndm_v,deis,res_multistep,res_multistep_cfg_pp,res_multistep_ancestral,res_multistep_ancestral_cfg_pp,gradient_estimation,gradient_estimation_cfg_pp,er_sde,seeds_2,seeds_3,sa_solver,sa_solver_pece,ddim,uni_pc,uni_pc_bh2
    schedulersimple,sgm_uniform,karras,exponential,ddim_uniform,beta,normal,linear_quadratic,kl_optimal
    denoiseFLOAT
    parameters_jsonSTRING