Cna2 / comfyui /README.md
Badnerle1234454's picture
Upload 2 files
dde8ccd verified

WithAnyone ComfyUI Node

This folder contains a custom ComfyUI node that wraps the WithAnyone inference pipeline.

Installation Steps

  1. Copy (or symlink) the file withanyone_node.py into your ComfyUI custom_nodes/ directory.
  2. Make sure the WithAnyone project (this repository) and all dependencies from requirements.txt are installed in the same Python environment you use to run ComfyUI.
  3. Download the required model checkpoints (Flux, SigLIP, CLIP, T5, WithAnyone IPA weights) to your local machine or rely on Hugging Face automatic downloads. Update the node inputs if you store them in custom locations.
  4. Launch ComfyUI. The node appears in the withanyone category as WithAnyone (Flux).

Node Inputs

Input Description
prompt Text prompt used during generation.
ref_images One or more reference portraits (tensor input from ComfyUI). Faces are detected via InsightFace.
manual_bboxes Optional bounding boxes (x1,y1,x2,y2 separated by semicolons or JSON) that place each identity in the final image. Leave empty to use default layouts.
width / height Output resolution (multiples of 16 recommended).
num_steps Number of diffusion steps.
guidance Guidance scale (CFG).
seed Random seed for reproducibility.
model_type Underlying Flux backbone (flux-dev, flux-dev-fp8, flux-schnell).
id_weight / siglip_weight Weights for identity preservation vs. semantic alignment.
only_lora, offload, lora_rank, lora_weight, additional_lora Advanced controls for LoRA usage.
ipa_path, clip_path, t5_path, flux_path, siglip_path Paths or Hugging Face identifiers for checkpoints.

Outputs

The node returns:

  • Generated image as a ComfyUI IMAGE.
  • Metadata dictionary containing seed, resolution, steps, guidance, bounding boxes, and model type.

Notes

  • The node reuses the project’s FaceExtractor to obtain ArcFace embeddings from the provided references. If a face cannot be detected, the node raises an error.
  • When no bounding boxes are supplied, a default layout is chosen based on the number of reference faces. The defaults are designed for 512×512 images; the node scales them to the requested resolution.
  • For background matting or more advanced mask handling, extend the node to leverage WithAnyone’s matting utilities.