InfiniteYou

bytedanceApache-2.0长期未更新

基于 FLUX 扩散 Transformer 的身份保持图像生成工具,上传几张人脸照片就能在换场景、换风格时保持长相一致,适合做个性化写真和照片重绘。

🔥 [ICCV 2025 Highlight] InfiniteYou: Flexible Photo Recrafting While Preserving Your Identity

暂无版本2,690star285fork同步于 2026-11-07 07:30 UTC

怎么上手

由 README 提炼,执行前请确认
pip install -r requirements.txt
python test.py --id_image ./assets/examples/man.jpg --prompt "A man, portrait, cinematic" --out_results_dir ./results
硬件要求按 README 说明

基于 FLUX.1-dev,bf16 全性能推理峰值显存约 43GB;加 --cpu_offload 约 30GB,加 --quantize_8bit 约 24GB,两者同开约 16GB。README 未说明 CPU 单独运行与 AMD 等非 NVIDIA 显卡支持。

16G 显存可跑
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

字节跳动开源的 FLUX 身份保持图像生成框架,换脸同时保住相似度和画质

基于 FLUX 扩散 Transformer 的身份保持图像生成工具,上传几张人脸照片就能在换场景、换风格时保持长相一致,适合做个性化写真和照片重绘。

核心能力

  • 用 InfuseNet 通过残差连接向 DiT 注入身份特征
  • 多阶段训练加合成单人多样本数据缓解人脸复制粘贴
  • 提供 aes_stage2 与 sim_stage1 两个模型变体切换
  • 支持 8bit 量化与 CPU offload 组合降低显存占用
  • 官方 ComfyUI 节点与 Gradio 本地演示

容易踩的坑

默认从 HuggingFace 拉取 black-forest-labs/FLUX.1-dev 和 ByteDance/InfiniteYou,需提前备好权重或改路径;显存不足 43GB 时要手动加 --cpu_offload 或 --quantize_8bit;想提高身份相似度需用 --model_version sim_stage1 切换,默认是 aes_stage2。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

0 个版本

暂无 release 数据(可能没有发版,或尚未同步)。

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    InfiniteYou: Flexible Photo Recrafting While Preserving Your Identity

    Liming Jiang     Qing Yan     Yumin Jia     Zichuan Liu     Hao Kang     Xin Lu ByteDance Intelligent Creation ICCV 2025 (Highlight)

             

    teaser

    Abstract: Achieving flexible and high-fidelity identity-preserved image generation remains formidable, particularly with advanced Diffusion Transformers (DiTs) like FLUX. We introduce InfiniteYou (InfU), one of the earliest robust frameworks leveraging DiTs for this task. InfU addresses significant issues of existing methods, such as insufficient identity similarity, poor text-image alignment, and low generation quality and aesthetics. Central to InfU is InfuseNet, a component that injects identity features into the DiT base model via residual connections, enhancing identity similarity while maintaining generation capabilities. A multi-stage training strategy, including pretraining and supervised fine-tuning (SFT) with synthetic single-person-multiple-sample (SPMS) data, further improves text-image alignment, ameliorates image quality, and alleviates face copy-pasting. Extensive experiments demonstrate that InfU achieves state-of-the-art performance, surpassing existing baselines. In addition, the plug-and-play design of InfU ensures compatibility with various existing methods, offering a valuable contribution to the broader community.

    🔥 News

    • [07/2025] 🔥 The paper of InfiniteYou is selected as ICCV 2025 (Highlight).

    • [06/2025] 🔥 The paper of InfiniteYou is accepted to ICCV 2025.

    • [04/2025] 🔥 The official ComfyUI node is released. Unofficial ComfyUI contributions are appreciated.

    • [04/2025] 🔥 Quantization and offloading options are provided to reduce the memory requirements for InfiniteYou-FLUX v1.0.

    • [03/2025] 🔥 The code, model, and demo of InfiniteYou-FLUX v1.0 are released.

    • [03/2025] 🔥 The project page of InfiniteYou is created.

    • [03/2025] 🔥 The paper of InfiniteYou is released on arXiv.

    💡 Important Usage Tips

    • We released two model variants of InfiniteYou-FLUX v1.0: aes_stage2 and sim_stage1. The aes_stage2 is our model after SFT, which is used by default for better text-image alignment and aesthetics. For higher ID similarity, please try sim_stage1 (using --model_version to switch). More details can be found in our paper.

    • To better fit specific personal needs, we find that two arguments are highly useful to adjust: --infusenet_conditioning_scale (default: 1.0) and --infusenet_guidance_start (default: 0.0). Usually, you may NOT need to adjust them. If necessary, start by trying a slightly larger --infusenet_guidance_start (e.g., 0.1) only (especially helpful for sim_stage1). If still not satisfactory, then try a slightly smaller --infusenet_conditioning_scale (e.g., 0.9).

    • We also provided two LoRAs (Realism and Anti-blur) to enable additional usage flexibility. If needed, try Realism only first. They are entirely optional, which are examples to try but are NOT used in our paper.

    • If the generated gender does not align with your preferences, try adding specific words in the text prompt, such as 'a man', 'a woman', etc. We encourage users to use inclusive and respectful language.

    :european_castle: Model Zoo

    InfiniteYou VersionModel VersionBase Model Trained withDescription
    InfiniteYou-FLUX v1.0aes_stage2FLUX.1-devStage-2 model after SFT. Better text-image alignment and aesthetics.
    InfiniteYou-FLUX v1.0sim_stage1FLUX.1-devStage-1 model before SFT. Higher identity similarity.

    🔧 Requirements and Installation

    Dependencies

    Simply run this one-line command to install (feel free to create a python3 virtual environment before you run):

    pip install -r requirements.txt
    

    Memory Requirements

    • Full-performance: The original bf16 model inference requires a peak VRAM of around 43GB.

    • Fast CPU offloading: By specifying only --cpu_offload in test.py, the peak VRAM is reduced to around 30GB with NO performance degradation.

    • 8-bit quantization: By specifying only --quantize_8bit in test.py, the peak VRAM is reduced to around 24GB with performance remaining very similar.

    • Combining fast CPU offloading and 8-bit quantization: By specifying both --cpu_offload and --quantize_8bit, the peak VRAM is further reduced to around 16GB with performance remaining very similar.

    If you want to use our models but only have a GPU with even less VRAM, please further refer to Diffusers memory reduction tips, where some more aggressive strategies may be helpful. Community contributions are also welcome.

    ⚡️ Quick Inference

    Local Inference Script

    python test.py --id_image ./assets/examples/man.jpg --prompt "A man, portrait, cinematic" --out_results_dir ./results
    
    • Input and output:
      • --id_image (str): The path to the input identity (ID) image. Default: ./assets/examples/man.jpg.
      • --prompt (str): The text prompt for image generation. Default: A man, portrait, cinematic.
      • --out_results_dir (str): The path to the output directory to save the generated results. Default: ./results.
      • --control_image (str or None): The path to the control image [optional] to extract five facical keypoints to control the generation. Default: None.
      • --base_model_path (str): The huggingface or local path to the base model. Default: black-forest-labs/FLUX.1-dev.
      • --model_dir (str): The path to the InfiniteYou model directory. Default: ByteDance/InfiniteYou.
    • Version control:
      • --infu_flux_version (str): InfiniteYou-FLUX version: currently only v1.0 is supported. Default: v1.0.
      • --model_version (str): The model variant to use: aes_stage2 | sim_stage1. Default: aes_stage2.
    • General inference arguments:
      • --cuda_device (int): The cuda device ID to use. Default: 0.
      • --seed (int): The seed for reproducibility (0 for random). Default: 0.
      • --guideance_scale (float): The guidance scale for the diffusion process. Default: 3.5.
      • --num_steps (int): The number of inference steps. Default: 30.
    • InfiniteYou-specific arguments:
      • --infusenet_conditioning_scale (float): The scale for the InfuseNet conditioning. Default: 1.0.
      • --infusenet_guidance_start (float): The start point for the InfuseNet guidance injection. Default: 0.0.
      • --infusenet_guidance_end (float): The end point for the InfuseNet guidance injection. Default: 1.0.
    • Optional LoRAs:
      • --enable_realism_lora (store_true): Whether to enable the Realism LoRA. Default: False.
      • --enable_anti_blur_lora (store_true): Whether to enable the Anti-blur LoRA. Default: False.
    • Memory reduction options:
      • --quantize_8bit (store_true): Whether to quantize the model to the 8-bit format. Default: False.
      • --cpu_offload (store_true): Whether to use fast CPU offloading. Default: False.

    Local Gradio Demo

    python app.py
    

    Online Hugging Face Demo

    We appreciate the GPU grant from the Hugging Face team. You can also try our InfiniteYou-FLUX Hugging Face demo online.

    ComfyUI Nodes

    🆚 Comparison with State-of-the-Art Relevant Methods

    comparative_results

    Qualitative comparison results of InfU with the state-of-the-art baselines, FLUX.1-dev IP-Adapter and PuLID-FLUX. The identity similarity and text-image alignment of the results generated by FLUX.1-dev IP-Adapter (IPA) are inadequate. PuLID-FLUX generates images with decent identity similarity. However, it suffers from poor text-image alignment (Columns 1, 2, 4), and the image quality (e.g., bad hands in Column 5) and aesthetic appeal are degraded. In addition, the face copy-paste issue of PuLID-FLUX is evident (Column 5). In comparison, the proposed InfU outperforms the baselines across all dimensions.

    ⚙️ Plug-and-Play Property with Off-the-Shelf Popular Approaches

    plug_and_play

    InfU features a desirable plug-and-play design, compatible with many existing methods. It naturally supports base model replacement with any variants of FLUX.1-dev, such as FLUX.1-schnell for more efficient generation (e.g., in 4 steps). The compatibility with ControlNets and LoRAs provides more controllability and flexibility for customized tasks. Notably, the compatibility with OminiControl extends our potential for multi-concept personalization, such as interacted identity (ID) and object personalized generation. InfU is also compatible with IP-Adapter (IPA) for stylization of personalized images, producing decent results when injecting style references via IPA. Our plug-and-play feature may extend to even more approaches, providing valuable contributions to the broader community.

    📜 Disclaimer and Licenses

    The images used in this repository and related demos are sourced from consented subjects or generated by the models. These pictures are intended solely to showcase the capabilities of our research. If you have any concerns, please feel free to contact us, and we will promptly remove any inappropriate content.

    The use of the released code, model, and demo must strictly adhere to the respective licenses. Our code is released under the Apache License 2.0, and our model is released under the Creative Commons Attribution-NonCommercial 4.0 International Public License for academic research purposes only. Any manual or automatic downloading of the face models from InsightFace, the FLUX.1-dev base model, LoRAs (Realism and Anti-blur), etc., must follow their original licenses and be used only for academic research purposes.

    This research aims to positively impact the field of Generative AI. Any usage of this method must be responsible and comply with local laws. The developers do not assume any responsibility for any potential misuse.

    🤗 Acknowledgments

    We sincerely acknowledge the insightful discussions from Stathi Fotiadis, Min Jin Chong, Xiao Yang, Tiancheng Zhi, Jing Liu, and Xiaohui Shen. We genuinely appreciate the help from Jincheng Liang and Lu Guo with our user study and qualitative evaluation.

    📖 Citation

    If you find InfiniteYou useful for your research or applications, please cite our paper:

    @inproceedings{jiang2025infiniteyou,
      title={{InfiniteYou}: Flexible Photo Recrafting While Preserving Your Identity},
      author={Jiang, Liming and Yan, Qing and Jia, Yumin and Liu, Zichuan and Kang, Hao and Lu, Xin},
      booktitle={ICCV},
      year={2025}
    }
    

    We also appreciate it if you could give a star :star: to this repository. Thanks a lot!