✨ [ICLR'26] WithAnyone is capable of generating high-quality, controllable, and ID consistent images
578
stars
53
commits
Python
primary language
Mar 21, 2026
updated
Star us if you find this project useful! ⭐
A huge thanks to @okdalto for contributing the ComfyUI integration!
The ComfyUI version of WithAnyone is now available — check it out here and enjoy a seamless node-based workflow within the ComfyUI environment.
Highlight of WithAnyone
| Model | Description | Download |
|---|---|---|
| WithAnyone 1.0 - FLUX.1 | Main model with FLUX.1 | HuggingFace |
| WithAnyone.K.preview - FLUX.1 Kontext | For t2i generation with FLUX.1 Kontext | HuggingFace |
| WithAnyone.Ke.preview - FLUX.1 Kontext | For face-editing with FLUX.1 Kontext | HuggingFace |
If you just want to try it out, please use the base model WithAnyone - FLUX.1. The other models are for the following use cases:
Use pip install -r requirements.txt to install the necessary packages.
You can download the necessary model checkpoints in one of the two ways:
hf_hub_download function in the code to your $HF_HOME (default: ~/.cache/huggingface).huggingface-cli download <repo name> to download:
black-forest-labs/FLUX.1-devxlabs-ai/xflux_text_encodersopenai/clip-vit-large-patch14google/siglip-base-patch16-256-i18nwithanyone/withanyoneblack-forest-labs/FLUX.1-dev:huggingface-cli download black-forest-labs/FLUX.1-dev flux1-dev.safetensorshuggingface-cli download black-forest-labs/FLUX.1-dev ae.safetensorsblack-forest-labs/FLUX.1-dev model repo (it is there for diffusers calls). All checkpoints together require about 51 GB of disk space (~40 in hub and 10 in xet).After downloading, set the following arguments in the inference script to the local paths of the downloaded checkpoints:
--flux_path <path to flux1-dev.safetensors>
--clip_path <path to clip-vit-large-patch14>
--t5_path <path to xflux_text_encoders>
--siglip_path <path to siglip-base-patch16-256-i18n>
--ipa_path <path to withanyone>
mv models/antelopev2/ models/antelopev2_ mv models/antelopev2_/antelopev2/ models/antelopev2/ rm -rf models/antelopev2_, antelopev2.zip
The Gradio GUI demo is a good starting point to experiment with WithAnyone. Run it with:
python gradio_app.py --flux_path <path to flux1-dev directory> --ipa_path <path to withanyone directory> \
--clip_path <path to clip-vit-large-patch14> \
--t5_path <path to xflux_text_encoders> \
--siglip_path <path to siglip-base-patch16-256-i18n> \
--model_type "flux-dev" # or "flux-kontext" for WithAnyone.K
❗ WithAnyone requires face bounding boxes (bboxes). You should provide them to indicate where faces are. You can provide face bboxes in two ways:
Mask Configuration (Option 1: Automatic). The face bboxes will be extracted automatically, and faces will be generated in the same locations. Do not worry if the given image has a different resolution or aspect ratio; the face bboxes will be resized accordingly.Mask Configuration (Option 2: Manual). The format is x1,y1,x2,y2 for each face, one per line.⭕ WithAnyone works well with LoRA. If you have any stylized LoRA checkpoints, use --additional_lora_ckpt <path to lora checkpoint> when launching the demo. The LoRA will be merged into the diffusion model.
python gradio_app.py --flux_path <path to flux1-dev directory> --ipa_path <path to withanyone directory> \
--additional_lora_ckpt <path to lora checkpoint> \
--lora_scale 0.8 # adjust the weight as needed
⭕ In Advanced Options, there is a slider controlling whether outputs are more "similar in spirit" or "similar in form" to the reference faces.
SigLIP is a general image embedding model, capturing more than just faces, while ArcFace is a face-specific embedding model, capturing only identity information.
When using high arcface weight (slider to the left), please add more description of the identity in the prompt, since arcface embedding may lose information like hairstyle, skin color, body build, age, etc.
Be prepared for the first few runs as it may not be very satisfying.
You can use infer_withanyone.py for batch inference. The script supports generating multiple images with MultiID-Bench.
Download from HuggingFace.
huggingface-cli download WithAnyone/MultiID-Bench --repo-type dataset --local-dir <path to MultiID-Bench directory>
And convert the arrow file to a folder of images and a json file using MultiID_Bench/hf2bench.py:
python MultiID_Bench/parquet2bench.py --parquet <path to local dir> --output_dir <path to output directory>
You will get a folder with the following structure:
<output_dir>/
├── p1/untar
├── p2/untar
├── p3/
├── p1.json
├── p2.json
└── p3.json
python infer_withanyone.py \
--eval_json_path <path to MultiID-Bench subset json> \
--data_root <path to MultiID-Bench subset images> \
--save_path <path to save results> \
--use_matting True \ # set to True when siglip_weight > 0.0
--siglip_weight 0.0 \ # Resemblance in Spirit vs Resemblance in Form, higher means more similar to reference
--id_weight 1.0 \ # usually, set it to 1 - id_weight, higher means more controllable
--t5_path <path to xflux_text_encoders> \
--clip_path <path to clip-vit-large-patch14> \
--ipa_path <path to withanyone> \
--flux_path <path to flux1-dev>
Where the data_root should be p1/untar, p2/untar, or p3/ depending on which subset you want to evaluate. The eval_json_path should be the corresponding json file converted from the parquet file.
You can use gradio_edit.py for face editing with FLUX.1 Kontext and WithAnyone.Ke.
python gradio_edit.py --flux_path <path to flux1-dev directory> --ipa_path <path to withanyone directory> \
--clip_path <path to clip-vit-large-patch14> \
--t5_path <path to xflux_text_encoders> \
--model_type "flux-kontext"
Please refer to TRAIN.md for the training codebase.
The code of WithAnyone is released under the Apache License 2.0, while the WithAnyone model and associated datasets are made available solely for non-commercial academic research purposes.
License Terms:
The WithAnyone model is distributed under the FLUX.1 [dev] Non-Commercial License v1.1.1. All underlying base models remain governed by their respective original licenses and terms, which shall continue to apply in full. Users must comply with all such applicable licenses when using this project.
Permitted Use:
This project may be used for lawful academic research, analysis, and non-commercial experimentation only. Any form of commercial use, redistribution for profit, or application that violates applicable laws, regulations, or ethical standards is strictly prohibited.
User Obligations:
Users are solely responsible for ensuring that their use of the model and dataset complies with all relevant laws, regulations, institutional review policies, and third-party license terms.
Disclaimer of Liability:
The authors, developers, and contributors make no warranties, express or implied, regarding the accuracy, reliability, or fitness of this project for any particular purpose. They shall not be held liable for any damages, losses, or legal claims arising from the use or misuse of this project, including but not limited to violations of law or ethical standards by end users.
Acceptance of Terms:
By downloading, accessing, or using this project, you acknowledge and agree to be bound by the applicable license terms and legal requirements, and you assume full responsibility for all consequences resulting from your use.
We thank the following prior art for their excellent open source work:
If you find this project useful in your research, please consider citing:
@article{xu2025withanyone,
title={WithAnyone: Towards Controllable and ID-Consistent Image Generation},
author={Hengyuan Xu and Wei Cheng and Peng Xing and Yixiao Fang and Shuhan Wu and Rui Wang and Xianfang Zeng and Gang Yu and Xinjun Ma and Yu-Gang Jiang},
journal={arXiv preprint arxiv:2510.14975},
year={2025}
}
Python
99.9%
✨ [ICLR'26] WithAnyone is capable of generating high-quality, controllable, and ID consistent images
578
stars
53
commits
Python
primary language
Mar 21, 2026
updated
Star us if you find this project useful! ⭐
A huge thanks to @okdalto for contributing the ComfyUI integration!
The ComfyUI version of WithAnyone is now available — check it out here and enjoy a seamless node-based workflow within the ComfyUI environment.
Highlight of WithAnyone
| Model | Description | Download |
|---|---|---|
| WithAnyone 1.0 - FLUX.1 | Main model with FLUX.1 | HuggingFace |
| WithAnyone.K.preview - FLUX.1 Kontext | For t2i generation with FLUX.1 Kontext | HuggingFace |
| WithAnyone.Ke.preview - FLUX.1 Kontext | For face-editing with FLUX.1 Kontext | HuggingFace |
If you just want to try it out, please use the base model WithAnyone - FLUX.1. The other models are for the following use cases:
Use pip install -r requirements.txt to install the necessary packages.
You can download the necessary model checkpoints in one of the two ways:
hf_hub_download function in the code to your $HF_HOME (default: ~/.cache/huggingface).huggingface-cli download <repo name> to download:
black-forest-labs/FLUX.1-devxlabs-ai/xflux_text_encodersopenai/clip-vit-large-patch14google/siglip-base-patch16-256-i18nwithanyone/withanyoneblack-forest-labs/FLUX.1-dev:huggingface-cli download black-forest-labs/FLUX.1-dev flux1-dev.safetensorshuggingface-cli download black-forest-labs/FLUX.1-dev ae.safetensorsblack-forest-labs/FLUX.1-dev model repo (it is there for diffusers calls). All checkpoints together require about 51 GB of disk space (~40 in hub and 10 in xet).After downloading, set the following arguments in the inference script to the local paths of the downloaded checkpoints:
--flux_path <path to flux1-dev.safetensors>
--clip_path <path to clip-vit-large-patch14>
--t5_path <path to xflux_text_encoders>
--siglip_path <path to siglip-base-patch16-256-i18n>
--ipa_path <path to withanyone>
mv models/antelopev2/ models/antelopev2_ mv models/antelopev2_/antelopev2/ models/antelopev2/ rm -rf models/antelopev2_, antelopev2.zip
The Gradio GUI demo is a good starting point to experiment with WithAnyone. Run it with:
python gradio_app.py --flux_path <path to flux1-dev directory> --ipa_path <path to withanyone directory> \
--clip_path <path to clip-vit-large-patch14> \
--t5_path <path to xflux_text_encoders> \
--siglip_path <path to siglip-base-patch16-256-i18n> \
--model_type "flux-dev" # or "flux-kontext" for WithAnyone.K
❗ WithAnyone requires face bounding boxes (bboxes). You should provide them to indicate where faces are. You can provide face bboxes in two ways:
Mask Configuration (Option 1: Automatic). The face bboxes will be extracted automatically, and faces will be generated in the same locations. Do not worry if the given image has a different resolution or aspect ratio; the face bboxes will be resized accordingly.Mask Configuration (Option 2: Manual). The format is x1,y1,x2,y2 for each face, one per line.⭕ WithAnyone works well with LoRA. If you have any stylized LoRA checkpoints, use --additional_lora_ckpt <path to lora checkpoint> when launching the demo. The LoRA will be merged into the diffusion model.
python gradio_app.py --flux_path <path to flux1-dev directory> --ipa_path <path to withanyone directory> \
--additional_lora_ckpt <path to lora checkpoint> \
--lora_scale 0.8 # adjust the weight as needed
⭕ In Advanced Options, there is a slider controlling whether outputs are more "similar in spirit" or "similar in form" to the reference faces.
SigLIP is a general image embedding model, capturing more than just faces, while ArcFace is a face-specific embedding model, capturing only identity information.
When using high arcface weight (slider to the left), please add more description of the identity in the prompt, since arcface embedding may lose information like hairstyle, skin color, body build, age, etc.
Be prepared for the first few runs as it may not be very satisfying.
You can use infer_withanyone.py for batch inference. The script supports generating multiple images with MultiID-Bench.
Download from HuggingFace.
huggingface-cli download WithAnyone/MultiID-Bench --repo-type dataset --local-dir <path to MultiID-Bench directory>
And convert the arrow file to a folder of images and a json file using MultiID_Bench/hf2bench.py:
python MultiID_Bench/parquet2bench.py --parquet <path to local dir> --output_dir <path to output directory>
You will get a folder with the following structure:
<output_dir>/
├── p1/untar
├── p2/untar
├── p3/
├── p1.json
├── p2.json
└── p3.json
python infer_withanyone.py \
--eval_json_path <path to MultiID-Bench subset json> \
--data_root <path to MultiID-Bench subset images> \
--save_path <path to save results> \
--use_matting True \ # set to True when siglip_weight > 0.0
--siglip_weight 0.0 \ # Resemblance in Spirit vs Resemblance in Form, higher means more similar to reference
--id_weight 1.0 \ # usually, set it to 1 - id_weight, higher means more controllable
--t5_path <path to xflux_text_encoders> \
--clip_path <path to clip-vit-large-patch14> \
--ipa_path <path to withanyone> \
--flux_path <path to flux1-dev>
Where the data_root should be p1/untar, p2/untar, or p3/ depending on which subset you want to evaluate. The eval_json_path should be the corresponding json file converted from the parquet file.
You can use gradio_edit.py for face editing with FLUX.1 Kontext and WithAnyone.Ke.
python gradio_edit.py --flux_path <path to flux1-dev directory> --ipa_path <path to withanyone directory> \
--clip_path <path to clip-vit-large-patch14> \
--t5_path <path to xflux_text_encoders> \
--model_type "flux-kontext"
Please refer to TRAIN.md for the training codebase.
The code of WithAnyone is released under the Apache License 2.0, while the WithAnyone model and associated datasets are made available solely for non-commercial academic research purposes.
License Terms:
The WithAnyone model is distributed under the FLUX.1 [dev] Non-Commercial License v1.1.1. All underlying base models remain governed by their respective original licenses and terms, which shall continue to apply in full. Users must comply with all such applicable licenses when using this project.
Permitted Use:
This project may be used for lawful academic research, analysis, and non-commercial experimentation only. Any form of commercial use, redistribution for profit, or application that violates applicable laws, regulations, or ethical standards is strictly prohibited.
User Obligations:
Users are solely responsible for ensuring that their use of the model and dataset complies with all relevant laws, regulations, institutional review policies, and third-party license terms.
Disclaimer of Liability:
The authors, developers, and contributors make no warranties, express or implied, regarding the accuracy, reliability, or fitness of this project for any particular purpose. They shall not be held liable for any damages, losses, or legal claims arising from the use or misuse of this project, including but not limited to violations of law or ethical standards by end users.
Acceptance of Terms:
By downloading, accessing, or using this project, you acknowledge and agree to be bound by the applicable license terms and legal requirements, and you assume full responsibility for all consequences resulting from your use.
We thank the following prior art for their excellent open source work:
If you find this project useful in your research, please consider citing:
@article{xu2025withanyone,
title={WithAnyone: Towards Controllable and ID-Consistent Image Generation},
author={Hengyuan Xu and Wei Cheng and Peng Xing and Yixiao Fang and Shuhan Wu and Rui Wang and Xianfang Zeng and Gang Yu and Xinjun Ma and Yu-Gang Jiang},
journal={arXiv preprint arxiv:2510.14975},
year={2025}
}
Python
99.9%