Nodes/comfyui-magic-clothing/Load Magic Clothing Adapter &Diffusers
ComfyUI Node

Load Magic Clothing Adapter &Diffusers

Where the diffusers side actually loads the Magic Clothing weights

By longgui0318·Created 2 years ago·Updated 2 years ago· 82
Load Magic Clothing Adapter &Diffusers
  • pipeline
  • MagicClothingAdapter
magicClothingUnet

Load Magic Clothing Adapter is the moment the pack's diffusers side gets real: it takes the Magic Clothing weights and the assembled pipeline, and fuses them into the single object that RUN Magic Clothing Diffusers Model will actually drive. It's the diffusers-line equivalent of Load Magic Clothing Model on the native path - same weights, different plumbing.

It sits at the end of the pipeline-assembly chain, after the pipeline has been loaded, given a dtype and device, given a scheduler, and given a VAE:

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 and gives

  • magicClothingUnet - a dropdown of UNet files in ComfyUI/models/unet. This is the adapter weights file from HuggingFace's ShineChen1024/MagicClothing repo (e.g. magic_clothing_768_vitonhd_joint.safetensors).
  • pipeline (MAKED_PIPELINE) - the fully-assembled pipeline from Diffusers Model Makeup &MC. Note the type: it specifically wants the made-up pipeline, not the raw one, so the chain order matters.

Output is a single MagicClothingAdapter (MAGIC_CLOTHING_ADAPTER), which feeds the magicClothingAdapter input of the RUN node.

How it works

The node builds a ClothAdapter around your pipeline. Internally that does the whole Magic Clothing trick in diffusers terms:

  1. It deep-copies the pipeline's UNet to create a reference UNet.
  2. It loads your adapter file into that reference UNet with strict=False, so the adapter weights overwrite the matching layers and the base model fills the gaps.
  3. It patches the generation UNet and the reference UNet with special attention processors - write mode on the generation UNet, read mode on the reference.

During generation, the reference UNet runs on the clothing latent and stores its attention activations; the generation UNet then reads those stored features back, which is how the garment guides the denoising. The RUN node is what orchestrates that dance.

The one that matters: VRAM

This node is why Change Pipeline Dtype And Device sits earlier in the chain. Loading the adapter means loading a second full UNet next to the generation one, and at fp32 that's a recipe for OOM on most consumer cards. Run the pipeline fp16 and it's manageable; run it bf16 if your card prefers that. Also remember the adapter is SD 1.5 architecture - the whole pipeline must be an SD 1.5 checkpoint or the weight shapes won't line up and the strict=False load will quietly produce garbage.

Install

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

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

And drop the adapter file in ComfyUI/models/unet - the "model not found" errors people hit with this pack are almost universally the file sitting in models/checkpoints instead. If you're on the native path, you don't need this node at all; it only exists for the diffusers line.

Categoryloaders

Inputs (2)

NameTypeDefaultDescription
magicClothingUnetCOMBO0 options:
pipelineMAKED_PIPELINE

Outputs (1)

NameTypeDescription
MagicClothingAdapterMAGIC_CLOTHING_ADAPTER