ComfyUI-Leffa
Full-pipeline virtual try-on and pose transfer ComfyUI custom node, built on Meta's Leffa.
ComfyUI-Leffa
Full-pipeline virtual try-on and pose transfer ComfyUI custom node, built on
Meta's Leffa (MIT). Powers the
mcp.baisoln.com/leffa/* API.
Unlike StartHua/Comfyui_leffa — which
only runs the diffusion step and requires the caller to pre-compute a DensePose
image and an agnostic mask — these nodes run the entire pipeline inside
ComfyUI (human parsing → openpose → agnostic mask → densepose → Leffa diffusion),
mirroring upstream LeffaPredictor.leffa_predict, and they support pose transfer.
Nodes
| Node | Purpose |
|------|---------|
| Leffa Loader (LeffaLoader) | Loads one task model: viton_hd, viton_dc, or pose_transfer. |
| Leffa Virtual Try-On (LeffaTryOn) | person + garment IMAGE → tried-on image. garment_type ∈ {upper_body, lower_body, dresses}. |
| Leffa Pose Transfer (LeffaPoseTransfer) | person + target_pose IMAGE → reposed image. |
A typical graph: LoadImage(person) + LoadImage(garment) → LeffaLoader →
LeffaTryOn → SaveImage.
Models
Weights are expected under ComfyUI/models/Leffa/ (the whole
franciszzj/Leffa HF repo, ~34 GB):
hf download franciszzj/Leffa --local-dir ComfyUI/models/Leffa
Subtree used: virtual_tryon.pth, virtual_tryon_dc.pth, pose_transfer.pth,
stable-diffusion-inpainting/ (+ SDXL inpaint configs),
densepose/, humanparsing/, schp/, openpose/.
In the cluster these are bind-mounted from /mnt/ai-models/comfyui/models/Leffa.
Notes
- The vendored
detectron2/denseposeroute ROIAlign/NMS throughtorchvision.ops, so no detectron2 compilation is required for thedensepose_rcnn_R_50_FPN_s1xmodel used here. - Human parsing runs on CPU via onnxruntime; openpose/densepose/diffusion on GPU.
- Only one diffusion model is kept resident at a time (VRAM bound for the RTX 5090); switching task evicts the previous one.
torch/torchvision/transformerscome from the ComfyUI env and must not be upgraded; seerequirements.txt.
License
MIT (inherits franciszzj/Leffa). Vendored upstream source under leffa/,
leffa_utils/, preprocess/, detectron2/, densepose/, SCHP/.