ComfyUI Node

Virtual Try-On

Put the shirt on the model, not the model on the shirt

By khanhlvg·Created about a year ago·Updated about a year ago· 4
Virtual Try-On
  • person_image
  • product_image
  • images
project_id
locationus-central1
model
sampleCount1
seed1781057369
safetySetting
personGeneration

Virtual Try-On is the fashion-commerce node in the Vertex AI pack. Two images in - a person and a garment - one image out, the person wearing that garment as if it were shot that way. It's a deceptively hard task that local models still fumble: fabric drape, wrinkles, the way the garment should sit on a specific body. Google's dedicated model (virtual-try-on-preview-08-04) does it well enough that this node is the fastest path to convincing product shots that actually feature your catalog item.

What it is

A two-image generator. The person_image is your model or mannequin shot; the product_image is the garment on a hanger, folded, or as a flat lay. The model transfers the garment onto the person, respecting pose and body shape, and returns up to four variations. There's no prompt input at all - the images are the whole specification, which is both the appeal and the constraint.

How it works

The node writes both inputs to temp files and calls Imagen's recontext_image API with a source that pairs the person image with the product as a ProductImage. The config carries sample count, seed, safety level, and person generation. Returned images are decoded to RGBA tensors and stacked into a single batched IMAGE.

Inputs that matter

  • person_image - required. A clear, front-facing shot of the person (or mannequin), ideally in neutral clothing, well lit. Full-body or three-quarter shots work best; a tiny cropped bust means the model has less to anchor the garment to.
  • product_image - required. The garment itself. Flat lays and clean hanger shots transfer best; a garment photographed at an extreme angle or on another person will fight the model.
  • sampleCount (1–4), seed, safetySetting, personGeneration - the standard Imagen knobs. Note this node's personGeneration only offers ALLOW_ALL and ALLOW_ADULT, no "don't allow" - makes sense, people are the whole point.

Output is images, a standard IMAGE tensor.

Installing

Standard pack install - ComfyUI Manager → search "Vertex AI", or:

cd ComfyUI/custom_nodes
git clone https://github.com/khanhlvg/vertex-ai-comfyui-nodes.git
cd vertex-ai-comfyui-nodes
pip install -r requirements.txt

Then the shared setup: gcloud auth application-default login, GOOGLE_CLOUD_PROJECT and GOOGLE_CLOUD_LOCATION (defaults us-central1), billing-enabled project with the Vertex AI API on. No local models, no VRAM.

Where people get burned

  • Garbage in, garbage out is brutal here. If the person image is cluttered, low-res, or the garment shot is folded weirdly, the model hallucinates details - patterns especially. Start with clean studio-style inputs; the model can't fix a bad source.
  • Patterns and logos are the weak spot. Busy prints and brand logos tend to distort or smear across body contours. Solid colors and simple textures come out dramatically cleaner.
  • It's a preview model. Expect the occasional off geometry, and don't be surprised if Google changes the model string.
  • Both-or-neither discipline. You need both images - the node is unusable with one, so a half-wired workflow fails silently at the API call. It's a paid API, so a botched run is wasted money, not just time.

The workflow people actually run: batch a catalog of garment shots through with sampleCount set to 2–3, pick the best per garment, and you've replaced a photoshoot. Just remember this is the same recontext family as Product Recontext, so if one of them stops working, check the other - they share a skeleton.

CategoryVertex AI

Inputs (9)

NameTypeDefaultDescription
project_idSTRING
locationSTRINGus-central1
modelCOMBO1 options: virtual-try-on-preview-08-04
person_imageIMAGE
product_imageIMAGE
sampleCountoptINT11–4
seedoptINT17810573690–4294967295
safetySettingoptCOMBO4 options: BLOCK_ONLY_HIGH, BLOCK_MEDIUM_AND_ABOVE, BLOCK_LOW_AND_ABOVE, BLOCK_NONE
personGenerationoptCOMBO2 options: ALLOW_ALL, ALLOW_ADULT

Outputs (1)

NameTypeDescription
imagesIMAGE