Nodes/LCM_Inpaint_Outpaint_Comfy/LCMGenerate_img2img_IPAdapter
ComfyUI Node

LCMGenerate_img2img_IPAdapter

Image-prompted variations at 4 steps

By taabata·Created 3 years ago·Updated 2 years ago· 259
LCMGenerate_img2img_IPAdapter
  • image
  • ip_model
  • pil_image
  • IMAGE
seed0
text
steps4
width512
height512
cfg8.0
batch1
strength1.0
prompt_weighting
loopback
loopback_iterations4
scale1.0

LCMGenerate_img2img_IPAdapter is the generation node for the pack's image-prompting workflows: you give it a source image to rework, a reference image to borrow style or subject from, and it runs the 4-step LCM pipeline with an IP-Adapter pulling toward the reference. This is the node behind the pack's Image Variations trick, and it's the fastest way to "make this look more like that" in this whole pack.

The inputs that matter

This node is a slightly stripped-down img2img with an IP-Adapter instead of a mode/pipe pair:

  • image - the image you're starting from (the thing being varied).
  • pil_image - the reference image whose style/subject you want. Don't get thrown by the name; it's just an IMAGE input.
  • ip_model - the adapter, loaded by LCM_IPAdapter. This is a required class input; without it the node can't apply image prompting at all.
  • scale (default 1.0) - how hard the IP-Adapter pulls toward the reference. Lower it for subtlety. This is the main quality knob, and it interacts with strength.
  • strength (default 1.0) - how much of the original image survives. 1.0 redraws hard; 0.4–0.6 keeps the original composition.
  • loopback / loopback_iterations (default 4) - feed output back in repeatedly. Pairs well with IP-Adapter for gradually pushing an image toward a reference style.

Plus the standard set: seed, text, steps (4), width/height, cfg, batch, prompt_weighting.

How it works

The IP-Adapter injects an embedding of pil_image through its own cross-attention path while the LCM pipe does its fast denoising, and strength controls how much of image survives as the starting latent. In practice the combination is genuinely fun: at 4 steps you can iterate toward a reference style almost interactively. The usual LCM rules still apply - keep steps at 4–8 and don't run the 8.0 CFG default unless you want the oversaturated look.

Setup

Needs the full chain: pack installed (ComfyUI Manager → search LCM_Inpaint-Outpaint_Comfy, or clone + pip install -r requirements.txt), LCM_Dreamshaper_v7 in ComfyUI/models/diffusers/, your IP-Adapter .safetensors in ComfyUI/models/controlnet/, and a CLIP vision encoder in ComfyUI/models/clip_vision/. The ip_model comes from LCM_IPAdapter, which is where those model paths get resolved.

Gotchas

The scale vs strength fight is the thing to learn: crank both high and you get something that barely resembles the original or the reference. A sane starting point is strength ~0.6 and scale ~0.6–0.8, then tune one at a time. Also remember this is 2023-era code - the adapter is loaded in a heavier, less optimized way than today's native IPAdapter nodes, so watch VRAM on smaller cards. It's an early but working take on a now-standard technique.

CategoryLCM_Nodes/nodes

Inputs (15)

NameTypeDefaultDescription
seedINT00–18446744073709550000
textSTRING
stepsINT40–360
widthINT5120–5000
heightINT5120–5000
cfgFLOAT8.00–30
batchINT11–100
strengthFLOAT1.00–1
prompt_weightingCOMBO2 options: disable, enable
loopbackCOMBO2 options: disable, enable
loopback_iterationsINT41–5000
imageIMAGE
ip_modelclass
pil_imageIMAGE
scaleFLOAT1.00–1

Outputs (1)

NameTypeDescription
IMAGEIMAGE