π FRED Extract KSampler parameter
Read a KSampler's settings without touching it β then feed them forward
- ksampler_input
- seed
- steps
- cfg_guidance
- sampler
- scheduler
- denoise
- help
ComfyUI's KSampler holds its settings as widget values, and normally those values are locked inside the node - invisible to everything else in your graph unless you re-type them somewhere. FRED_ExtractKSampler_parameter reaches in and pulls them out. Connect it to your KSampler's input wire and it emits seed, steps, CFG, sampler, scheduler and denoise as proper typed outputs you can use anywhere.
What it does
The single required input is ksampler_input (type *, so it accepts any wire - the node doesn't care about the data, it cares about which node that wire came from). It looks up the upstream KSampler node, reads its widget values, and hands them back:
seed(INT)steps(INT)cfg_guidance(FLOAT)sampler(STRING) - e.g.euler,dpmpp_2mscheduler(STRING) - e.g.karras,normaldenoise(FLOAT)- plus the usual
help.
Because it inspects the connected node rather than re-parsing anything, it always reflects what's currently set. Change the seed in the KSampler and the extracted output updates on the next run. That's the whole trick, and it's surprisingly handy.
Why you'd want that
The classic case is metadata and filenames. The FRED Image Saver wants your seed, steps, CFG and sampler for its A1111-style parameters text - but wiring those by hand means keeping a second set of widgets in sync, which you will forget to do. Extract them from the KSampler and the saved parameters are always truthful.
Beyond saving: it's the glue for any node that needs to mirror sampling settings. Want a second sampler to run "with the same seed and CFG but a different scheduler"? Extract the seed from the first KSampler and wire it into the second. That "derive from the real source" pattern is why utility nodes like this earn their keep in bigger graphs - one source of truth instead of duplicated widgets.
How it reads the values
Mechanically it uses the prompt/unique_id context (ComfyUI's hidden inputs) to find the connected KSampler node in the workflow graph and pull its widget values, with the standard conversions to INT/FLOAT/STRING. It's read-only - the KSampler is untouched, no re-execution triggered.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/Poukpalaova/ComfyUI-FRED-Nodes_v2.git
Restart, or install "ComfyUI FRED Nodes v2" via ComfyUI Manager. No extra Python beyond the pack baseline.
Gotchas
It's built for the standard KSampler widget layout (seed, steps, cfg, sampler, scheduler, denoise). If you connect it to a radically different sampler node or a custom wrapper with unusual inputs, some outputs may come back empty or wrong - the node does its best to map the standard fields. And remember: the extraction reflects the widget values at execution time, so if you're feeding a seed that came from elsewhere into the KSampler, the extracted seed is whatever the KSampler shows, which is the right behavior for metadata but worth knowing.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| ksampler_input | * | β |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| seed | INT | β |
| steps | INT | β |
| cfg_guidance | FLOAT | β |
| sampler | STRING | β |
| scheduler | STRING | β |
| denoise | FLOAT | β |
| help | STRING | β |