ComfyUI Node

Refine Toggle

An A/B switch for your two-pass refinement

By Wicloz·Created 2 years ago·Updated 11 months ago· 1
Refine Toggle
  • primary_image
  • alternate_image
  • IMAGE
  • FLOAT
primary_denoise_strength0.33
alternate_denoise_strength0.50
use_alternatefalse

Refine Toggle is exactly what it sounds like: a switch. You give it two images, each with its own denoise strength, and a boolean decides which pair comes out the other side. One output is the image, the other is the matching denoise value - so a single flip of a widget swaps both what gets refined and how hard it's refined.

The workflow it's built for is the two-pass refinement you already know: pass one at low denoise for a subtle refresh, pass two at higher denoise for a heavier re-do. Defaults in the node even point that way - primary at 0.33, alternate at 0.5. Instead of muting nodes and re-routing wires to compare "subtle" against "strong", you flip use_alternate and rerun.

How it works

Under the hood it's a pure selector with no math. When use_alternate is true it returns (alternate_image, alternate_denoise_strength); otherwise (primary_image, primary_denoise_strength). That's the whole node - which is the point. It's a routing convenience, not a processing step, and it costs nothing to run.

Inputs and outputs

  • primary_image - an IMAGE, your first refinement source.
  • primary_denoise_strength (default 0.333, 0–1) - the denoise paired with the primary image.
  • alternate_image - an IMAGE, your second refinement source.
  • alternate_denoise_strength (default 0.5, 0–1) - the denoise paired with the alternate.
  • use_alternate (default false) - the switch.

Outputs are IMAGE and FLOAT. Wire the image into your img2img path (typically VAE Encode → sampler), and the float into wherever the sampler expects a denoise value. One honest caveat: the built-in KSampler's denoise is a widget, not a wired input, so the FLOAT output pairs best with samplers that expose denoise as a connectable input - or just set the widget to match the number the node shows.

Why you'd use it

Beyond the two-pass refine setup, it's a clean way to A/B two sources - say, an upscale-then-refine branch against a straight img2img branch - and pick a winner without deleting half the graph. Because both inputs are already rendered images, flipping the switch doesn't skip work; whichever branch you don't select was still computed upstream. That's fine for comparison runs, just don't expect it to save you GPU time.

Installing it

The pack publishes to the Comfy Registry, so: ComfyUI Manager → search "ComfyUI Simply Nodes" → install → restart. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/Wicloz/ComfyUI-Simply-Nodes

No requirements.txt, no model files, no GPU cost. It only moves tensors around.

Common issues

  • Both images required: the schema marks both primary_image and alternate_image as required. You can't leave one disconnected and expect a passthrough - feed both.
  • Denoise seems ignored: if your sampler's denoise isn't actually wired to this node's FLOAT output, changing use_alternate only swaps the image, not the strength. Make sure the value is actually reaching the sampler.
  • Expected skip, got rerun: remember this is a selector, not a bypasser. The unselected branch still runs. If you want to skip computation entirely, mute the upstream nodes instead.

It's a small utility in a pack of small utilities, and it does one thing without drama. If you're forever flipping between two refinement settings, it's a nicer home for that habit than the right-click menu.

Categoryutils

Inputs (5)

NameTypeDefaultDescription
primary_imageIMAGE
primary_denoise_strengthFLOAT0.330–1
alternate_imageIMAGE
alternate_denoise_strengthFLOAT0.500–1
use_alternateBOOLEANfalse

Outputs (2)

NameTypeDescription
IMAGEIMAGE
FLOATFLOAT