Nodes/paint-by-example @ ComfyUI/Paint by Example (advanced)
ComfyUI Node

Paint by Example (advanced)

The same 2022 model, now with dials

By phyblas·Created 2 years ago·Updated 4 months ago· 11
Paint by Example (advanced)
  • image
  • mask
  • example
  • IMAGE
seed0
steps30
cfg5.0
sampler_name
negative
resizefalse
width512
height512
resize_mode

Same pipeline, more knobs

Simple got you results and you want control. Paint by Example (advanced) is the exact same Paint-by-Example pipeline with the training wheels off: everything the simple node takes, plus a guidance scale, a scheduler picker, a negative prompt, and the option to force an output size. If you've read the simple node's page, the shared bits - the auto-downloaded Fantasy-Studio model, the >5GB first run, the float16 load, the cuda/mps/cpu device pick - all still apply. What changes is what this node passes into the pipeline and what it does to the image before sampling.

The inputs that actually matter

The core stays the same: image, mask, example, seed, steps (default 30). Then:

  • cfg - guidance scale, default 5. This is the dial for how hard the model tries to match the example's vibe. A bit above ~7 and colors start to oversaturate; 5 is a sane starting point and mostly where you'll leave it.
  • sampler_name - and here's the trap: this is not ComfyUI's KSampler list. It's a list of diffusers schedulers - pndm, euler, euler_ancestral, heun, dpmpp_sde, lms, ddpm, lcm, ipndm, ddim, uni_pc. The node hot-swaps the pipeline's scheduler to whichever you pick, so don't go hunting for dpmpp_2m - it isn't there. For a model this old the defaults are genuinely fine; pndm or ddim and move on.
  • negative - a real negative prompt (multiline, default empty). Probably the most useful addition here. "blurry, lowres, artifacts, oversaturated" does the usual job.
  • resize - boolean, off by default. Flip it on to force width/height (default 512, multiples of 8) and pick a resize_mode: bicubic, bilinear, lanczos, nearest, nearest-exact. It resizes both image and mask before inference. Handy when your source is an awkward shape - though 512 is about this model's comfort zone anyway, so upscaling after generation beats upscaling into it.

Output is a single IMAGE, exactly like the simple node.

The honest take

The dials don't lift the model's ceiling. The checkpoint is what it is - a 2022 exemplar inpainter that's rough around the edges and can wander from the example. What the extra inputs buy you is steering: a bit of negative prompt, a touch more guidance when it's being lazy, and a resize path for odd source resolutions. If your first output looks off, the fix is usually more steps or a slightly higher cfg - not sampler roulette.

Install and gotchas

Same as the rest of the pack. ComfyUI Manager, search "paint-by-example", or:

cd ComfyUI/custom_nodes
git clone https://github.com/phyblas/paint-by-example_comfyui

Restart after. Dependencies are diffusers, torch, torchvision. The two real failure modes to expect: the multi-gigabyte model download on first run, and the transformers incompatibility that the pack answers with pip install transformers==4.40.0 - a pin that can collide with other nodes wanting a newer transformers, so test it somewhere disposable before downgrading your main environment.

Categoryinpaint

Inputs (12)

NameTypeDefaultDescription
imageIMAGE
maskMASK
exampleIMAGE
seedINT00–18446744073709550000
stepsINT30
cfgFLOAT5.0
sampler_nameCOMBO11 options: pndm, euler, euler_ancestral, heun, dpmpp_sde, lms, +5
negativeSTRING
resizeBOOLEANfalse
widthINT512
heightINT512
resize_modeCOMBO5 options: bicubic, bilinear, lanczos, nearest, nearest-exact

Outputs (1)

NameTypeDescription
IMAGEIMAGE