Nodes/LCM_Inpaint_Outpaint_Comfy/LCMGenerate_img2img
ComfyUI Node

LCMGenerate_img2img

Fast img2img with loopback and a T2I adapter

By taabata·Created 3 years ago·Updated 2 years ago· 259
LCMGenerate_img2img
  • image
  • pipe
  • adapter_image
  • adapter
  • IMAGE
mode
seed0
text
steps4
width512
height512
cfg8.0
outpaint_size256
outpaint_direction
batch1
strength1.0
prompt_weighting
loopback
loopback_iterations4
adapter_weight1.0

LCMGenerate_img2img is the img2img edition of the pack's main sampler. Same structure as LCMGenerate - pick Inpaint or Outpaint, feed it an image, and it runs the 4-step LCM pipeline - but tuned for reworking existing images rather than filling masks: it adds a strength slider, a loopback mode, and optional T2I-Adapter conditioning. If you want the "image variations" or "blend" behavior from the pack's screenshots, this is the node.

The inputs that do the work

Everything from LCMGenerate is here (mode, seed, text, steps, width/height, cfg, image, outpaint_size/direction, pipe, batch, prompt_weighting), plus the img2img-specific set:

  • strength (default 1.0) - how much of the original image gets changed. 1.0 is nearly a full redraw; lower it toward 0.4–0.6 for subtle variations that keep the original composition. This is the first knob you'll touch.
  • loopback (disable/enable) and loopback_iterations (default 4) - when enabled, the node feeds its own output back in as the next input, running repeatedly. Each pass nudges the image further from the original. It's a cheap way to get more dramatic transformation, and it's exactly what the pack's img2img_loopback_workflow.json is built around.
  • adapter_image and adapter_weight (default 1.0) - optional T2I-Adapter conditioning. adapter_weight scales how hard the adapter's structural condition pulls. These need an adapter loaded via LCMT2IAdapter feeding the adapter input.

How it works

The pipeline is the same diffusers-based LCM pipe from LCMLoader, run at lcm_origin_steps=50 with your chosen step count and CFG. The img2img twist is that the input image is the starting latent, so strength controls how much of it survives denoising. Remember the distillation rules here: keep steps in the 4–8 range and drop CFG toward 1–2 instead of leaving the 8.0 default - that's the difference between "clean fast variation" and "oversaturated mess."

Setup

Same pack story as everywhere:

cd ComfyUI/custom_nodes
git clone https://github.com/taabata/LCM_Inpaint-Outpaint_Comfy
cd LCM_Inpaint-Outpaint_Comfy
pip install -r requirements.txt

Or ComfyUI Manager, search LCM_Inpaint-Outpaint_Comfy. The pipe comes from LCMLoader (or LCMLoader_img2img, which is the dedicated img2img loader in this pack), and LCM_Dreamshaper_v7 has to be in ComfyUI/models/diffusers/ or you'll hit the "couldn't connect to huggingface.co" error before anything renders.

Gotchas

Loopback is the feature that bites: each iteration re-randomizes the seed in the source, so a long loopback chain drifts unpredictably - set loopback_iterations low (2–4) and use strength to control how far you go instead. And the usual 2023-era caveats: Windows path quirks, CPU-only prompt weighting, and the fact that this whole pack predates today's native ComfyUI img2img tooling. It's a fun, fast way to iterate - just don't expect polished behavior around the edges.

CategoryLCM_Nodes/nodes

Inputs (19)

NameTypeDefaultDescription
modeCOMBO2 options: Inpaint, Outpaint
seedINT00–18446744073709550000
textSTRING
stepsINT40–360
widthINT5120–5000
heightINT5120–5000
cfgFLOAT8.00–30
imageIMAGE
outpaint_sizeINT2560–5000
outpaint_directionCOMBO4 options: left, right, top, bottom
pipeclass
batchINT11–100
strengthFLOAT1.00–1
prompt_weightingCOMBO2 options: disable, enable
loopbackCOMBO2 options: disable, enable
loopback_iterationsINT41–5000
adapter_imageIMAGE
adapter_weightFLOAT1.00–1
adapterclass

Outputs (1)

NameTypeDescription
IMAGEIMAGE