Nodes/comfyui-magic-clothing/RUN Magic Clothing Diffusers Model
ComfyUI Node

RUN Magic Clothing Diffusers Model

The modern press-play for the pack's diffusers try-on

By longgui0318·Created 2 years ago·Updated 2 years ago· 82
RUN Magic Clothing Diffusers Model
  • cloth_image
  • magicClothingAdapter
  • IMAGE
positive
negative
height768
width576
batch_size1
steps25
cfg5.00
cloth_guidance_scale2.50
seed1234

RUN Magic Clothing Diffusers Model is the current "make the image" node for this pack's diffusers pipeline line. It's the grown-up successor to RUN OMS: same idea - garment photo in, person wearing it out - but with actual prompt inputs and a batch knob instead of hardcoded text. If you've built the whole "&MC" pipeline chain, this is the node at the end that finally fires.

It's the last stop in the assembly:

Load Magic Clothing Pipeline → Change Pipeline Dtype And Device →
Diffusers Scheduler Loader &MC → Diffusers Model Makeup &MC →
Load Magic Clothing Adapter → RUN Magic Clothing Diffusers Model

What it takes

  • cloth_image (IMAGE) - the garment photo, ideally cut out of its background. This is your "what the person wears."
  • magicClothingAdapter (MAGIC_CLOTHING_ADAPTER) - the output of Load Magic Clothing Adapter.
  • positive / negative (STRING, multiline) - your prompts, written as plain text right in the node. Note these are strings, not CONDITIONING wires, and they default to empty - the pack's original example uses "a photography of a model,best quality, high quality" with the standard "bare, monochrome, lowres..." negative, and that's a solid starting point.
  • height (768) / width (576) - the pack's native output resolution, 4:3-ish portrait.
  • batch_size (1–4), steps (25), cfg (5), cloth_guidance_scale (2.5), seed (1234).

Output is a single IMAGE.

How it works

The node normalizes the cloth image to the [-1,1] range the diffusers VAE expects, encodes it to a latent, then calls the ClothAdapter's generate routine. That routine does the standard Magic Clothing two-phase dance: run the reference UNet on the clothing latent to capture its attention features, then denoise with a three-way classifier-free guidance where the cloth branch carries the garment and the text branch carries everything else:

noise_pred = uncond + cfg * (text - cloth) + cloth_guidance_scale * (cloth - uncond)

The division of labor is the thing to internalize: the garment comes from the image, not the prompt. The text describes the person, the pose, the scene. cloth_guidance_scale (default 2.5) is the dial for how hard the garment sticks - too low drifts toward "a similar shirt," too high starts morphing the clothing into the person.

The inputs that matter

Three, really. positive/negative for who the person is, cloth_guidance_scale for how faithful the garment stays, and seed for reproducibility when you finally land on a reroll that works. batch_size only goes to 4 and multiplies VRAM, so don't bump it casually.

There's also a quiet safety net worth knowing: if magicClothingAdapter isn't actually a ClothAdapter (wrong wire, failed load), the node returns your input image unchanged instead of crashing. That's deliberate - but it means "it ran fine and gave me my photo back" is a symptom, not success.

Install

ComfyUI Manager → "comfyui-magic-clothing", or:

cd ComfyUI/custom_nodes
git clone https://github.com/longgui0318/comfyui-oms-diffusion
# restart

Dependencies: diffusers and safetensors in your ComfyUI Python env, and the Magic Clothing adapter file in ComfyUI/models/unet (the "model not found" errors are almost always the file in the wrong folder). And keep the pack's honest caveat in your head: Magic Clothing has a low success rate and hates dense patterns, so plan for rerolls. When this node hits, though, it's the whole virtual-try-on loop in one box.

Categoryloaders

Inputs (11)

NameTypeDefaultDescription
cloth_imageIMAGE
magicClothingAdapterMAGIC_CLOTHING_ADAPTER
positiveSTRING
negativeSTRING
heightINT7680–2048
widthINT5760–2048
batch_sizeINT11–4
stepsINT250–100
cfgFLOAT5.000–10
cloth_guidance_scaleFLOAT2.500–10
seedINT12340–18446744073709550000

Outputs (1)

NameTypeDescription
IMAGEIMAGE