Nodes/SD Prompt Reader/SD Parameter Generator
ComfyUI Node

SD Parameter Generator

One node that loads the model and hands KSampler every setting — A1111-style control in ComfyUI

By receyuki·Created 3 years ago·Updated 2 years ago· 463
SD Parameter Generator
    • MODEL_NAME
    • VAE_NAME
    • MODEL
    • CLIP
    • VAE
    • SEED
    • STEPS
    • REFINER_START_STEP
    • CFG
    • SAMPLER_NAME
    • SCHEDULER
    • POSITIVE_ASCORE
    • NEGATIVE_ASCORE
    • WIDTH
    • HEIGHT
    • BATCH_SIZE
    • PARAMETERS
    ckpt_name
    vae_namebaked VAE
    model_versionSDv1 512px
    config_namenone
    seed-1
    steps20
    refiner_start0.80
    cfg8.0
    sampler_name
    scheduler
    positive_ascore6.00
    negative_ascore6.00
    aspect_ratiocustom
    width512
    height512
    batch_size1

    If you came from A1111, the most disorienting thing about ComfyUI isn't the node graph - it's that your sampler settings are scattered across a dozen widgets in the middle of it, and there's no clean record of what you actually generated with. SD Parameter Generator fixes that by being a single node that loads the model and outputs every generation parameter as typed values, plus a ready-to-write A1111 parameter block. The README calls it a control panel for complex workflows, and that's exactly right - it's the same idea as the AP workflow setup perilli popularized.

    How it works

    It's two nodes fused. First, a checkpoint loader: ckpt_name is required, it optionally loads a separate vae_name (defaulting to "baked VAE"), and it hands you MODEL, CLIP, and VAE outputs you can wire straight into KSampler. Second, a parameter packer: it outputs SEED, STEPS, CFG, SAMPLER_NAME, SCHEDULER, WIDTH, HEIGHT, and BATCH_SIZE as properly typed values - so the wiring from this one node into a KSampler covers both the model inputs and the numeric ones.

    The reason this pack exists is the PARAMETERS output, a string in A1111 format (Model: ..., Seed: ..., Steps: ..., CFG scale: ..., Sampler: ..., Scheduler: ..., Size: ...). You feed that into the SD Prompt Saver at the same time you feed the typed values into KSampler, and suddenly your ComfyUI output carries real A1111 metadata that Civitai and prompt readers understand. That's the whole trick: the generator produces one canonical set of parameters and serves both the sampler and the saver from it.

    Two inputs do real work beyond that. model_version (SDv1 512px, SDv2 768px, SDXL 1024px) combined with aspect_ratio auto-computes width and height for you - pick "3:2" and it sets the right pixel dimensions for whatever base model you selected, using the resolution math from Stability's docs and StableSwarmUI. Set aspect_ratio to "custom" and the raw width/height widgets take over. And refiner_start is the fraction of steps at which a refiner takes over - set 0.8 and the node outputs REFINER_START_STEP (base steps) that you feed into a refiner KSampler's start_at_step.

    seed defaults to -1, which means random - the seed generator here is adapted from rgthree's nodes, so you get the same "lock it by typing a number" behavior you already know. For SDXL there are also positive_ascore and negative_ascore inputs (the aesthetic-score conditioning SDXL uses), which get folded into the PARAMETERS text when model_version is set to SDXL.

    Installing it

    Part of the SD Prompt Reader pack, so it's the same install as everything else: ComfyUI Manager, search "SD Prompt Reader," or manually with the recursive clone (the --recursive matters - the pack's core ships as a submodule):

    cd ComfyUI/custom_nodes
    git clone --recursive https://github.com/receyuki/comfyui-prompt-reader-node.git
    cd comfyui-prompt-reader-node
    pip install -r requirements.txt
    

    Then restart. Only dependency is piexif; no model downloads - this node loads whatever checkpoint you already have.

    The one thing to watch

    Because it's both a loader and a parameter source, you have to run it before KSampler can start - no model, no sampling. That's fine in normal use, but if you're mid-refactor on a workflow and disconnect the MODEL output, KSampler just sits there complaining about a missing input. Also note the aspect-ratio presets only cover a fixed set of ratios; anything unusual means flipping to "custom" and typing the numbers yourself. Not a bug, just where the convenience stops.

    CategorySD Prompt Reader

    Inputs (16)

    NameTypeDefaultDescription
    ckpt_nameCOMBO0 options:
    vae_nameoptCOMBObaked VAE1 options: baked VAE
    model_versionoptCOMBOSDv1 512px3 options: SDv1 512px, SDv2 768px, SDXL 1024px
    config_nameoptCOMBOnone12 options: none, anything_v3.yaml, v1-inference.yaml, v1-inference_clip_skip_2.yaml, v1-inference_clip_skip_2_fp16.yaml, v1-inference_fp16.yaml, +6
    seedoptINT-1-3–18446744073709550000
    stepsoptINT201–10000
    refiner_startoptFLOAT0.800–1
    cfgoptFLOAT8.00–100
    sampler_nameoptCOMBO44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38
    scheduleroptCOMBO9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3
    positive_ascoreoptFLOAT6.000–1000
    negative_ascoreoptFLOAT6.000–1000
    aspect_ratiooptCOMBOcustom10 options: custom, 1:1 - 512x512 | 768x768 | 1024x1024, 4:3 - 576x448 | 864x672 | 1152x896, 3:4 - 448x576 | 672x864 | 896x1152, 3:2 - 608x416 | 912x624 | 1216x832, 2:3 - 416x608 | 624x912 | 832x1216, +4
    widthoptINT51216–16384
    heightoptINT51216–16384
    batch_sizeoptINT11–4096

    Outputs (17)

    NameTypeDescription
    MODEL_NAME
    VAE_NAME
    MODELMODEL
    CLIPCLIP
    VAEVAE
    SEEDINT
    STEPSINT
    REFINER_START_STEPINT
    CFGFLOAT
    SAMPLER_NAMEeuler,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
    POSITIVE_ASCOREFLOAT
    NEGATIVE_ASCOREFLOAT
    WIDTHINT
    HEIGHTINT
    BATCH_SIZEINT
    PARAMETERSSTRING