Nodes/ComfyUI-Replicate/Replicate cuuupid/idm-vton
ComfyUI Node

Replicate cuuupid/idm-vton

Virtual try-on (put a garment on a person) in ComfyUI

By replicate·Created 2 years ago·Updated 2 years ago· 207
Replicate cuuupid/idm-vton
  • garm_img
  • human_img
  • mask_img
  • IMAGE
garment_des
categoryupper_body
cropfalse
force_dcfalse
mask_onlyfalse
steps30
seed42
force_rerunfalse

This is a virtual try-on node: give it a photo of a person and a photo of a piece of clothing, and it renders the person wearing that clothing. IDM-VTON was one of the better open try-on models when it landed, and the reason you'd reach for it through ComfyUI is convenience - it's fiddly to set up locally, but as a Replicate node it just runs in the cloud. Which is the catch to get straight first: this node doesn't run on your GPU. It uploads your two images to Replicate, runs the model there, and returns the result, so you need a Replicate account and a REPLICATE_API_TOKEN, and you pay per run. Nothing installs locally except the wrapper.

How it works

Under the hood IDM-VTON is a diffusion model built for garment transfer. It figures out the region of the person's body the garment belongs on, warps the clothing image to match the pose and body, and inpaints it in while keeping the person's face, hair, and background intact. You can hand it a mask, but its real trick is generating a sensible one itself from the category you pick - so most of the time you just supply two clean photos and let it work.

The inputs and outputs that matter

  • garm_img (required) - the garment. A flat product shot on a plain background works best.
  • human_img (required) - the person you're dressing. A clear, front-facing shot where the relevant body area is visible.
  • category - upper_body, lower_body, or dresses. This is the one setting people get wrong. It tells the model where to place the garment and how to mask; a mismatch (a dress tagged upper_body) produces mangled results.
  • garment_des - a short text description of the garment ("a red plaid flannel shirt"). Optional, but it measurably sharpens fidelity.
  • steps (30, range 1–40) - denoising steps. 30 is a sensible default; drop it for speed, raise it for a touch more polish.

The output is a single IMAGE - the person wearing the garment - which you wire straight into a preview or save node. A couple of switches worth knowing: mask_img lets you supply your own mask instead of the auto one, mask_only returns just the generated mask (handy for debugging placement), and crop / force_dc toggle the model's cropping and a "difficult cases" mode. seed fixes the result; force_rerun bypasses Replicate's cache when identical inputs would otherwise return the same cached image.

How to install it

One install covers every Replicate node in the pack.

  • ComfyUI Manager: search ComfyUI-Replicate, install, restart.
  • Manual:
    cd ComfyUI/custom_nodes
    git clone https://github.com/replicate/comfyui-replicate
    cd comfyui-replicate
    pip install -r requirements.txt
    
    then restart.

No model downloads - the only dependency is the replicate pip package. Set your token before launching ComfyUI: export REPLICATE_API_TOKEN="r8_..." (from replicate.com/account/api-tokens).

Common issues & troubleshooting

The garment lands in the wrong place or looks smeared. Nine times out of ten it's the category. Match it to the garment type before anything else. If it's still off, add a garment_des and switch on force_dc for tricky items.

The face or hands distort. Try-on models focus their effort on the clothed region; anatomy at the edges can wobble, especially on busy or angled poses. Use a clean, well-lit, roughly front-on human_img and the model has far less to invent. If a face still drifts, run a separate face-restore or inpaint pass afterward rather than pushing this node harder.

It returned the same image again. That's the Replicate cache doing its job - identical inputs give you the identical (already-paid-for) result. Flip force_rerun to true, or change the seed, to force a genuinely new generation.

CategoryReplicate

Inputs (11)

NameTypeDefaultDescription
garm_imgIMAGE
human_imgIMAGE
garment_desoptSTRING
mask_imgoptIMAGE
categoryoptCOMBOupper_body3 options: upper_body, lower_body, dresses
cropoptBOOLEANfalse
force_dcoptBOOLEANfalse
mask_onlyoptBOOLEANfalse
stepsoptINT301–40
seedoptINT42
force_rerunoptBOOLEANfalse

Outputs (1)

NameTypeDescription
IMAGEIMAGE