IC Custom
[ICLR'26] IC-Custom: Diverse Image Customization via In-Context Learning
**IC Custom** is a [ICLR'26] IC-Custom: Diverse Image Customization via In-Context Learning The project is written primarily in Python, distributed under the Other license, first published in 2025. Key topics include: aigc, application, flux, image, image-customization.
๐ Overview
IC-Custom is designed for diverse image customization scenarios, including:
-
Position-aware: Input a reference image, target background, and specify the customization location (via segmentation or drawing)
- Examples: Product placement, virtual try-on
-
Position-free: Input a reference image and a target description to generate a new image with the reference image's ID
- Examples: IP customization and creation
โจ Note
- This is the first release of IC-Custom (0x1561) ๐.
- The model is currently stronger at masked customization for categories such as bags ๐, perfumes ๐, clothes ๐, and rigid objects.
- Training data ensures quality (โฅ800px โ ) but is still limited in scale and diversity. Face-related data and style transfer are not yet included.
- The position-free ability (IP customization without masks), along with other capabilities such as face customization, is still being improved and will be further refined based on community feedback ๐.
- We are also exploring acceleration techniques (quantization, distillation) and finer-grained customization (e.g., flexible control of product viewpoints ๐).
Community Support
-
ComfyUI: ComfyUI_RH_ICCustom
-
RunningHub:
-
Demonstration video:
Acknowledgements: ComfyUI deployment support by HM-RunningHub; RunningHub workflows by T8star-Aix.
๐ Table of Contents
- ๐ Overview
- โจ Note
- ๐ Table of Contents
- ๐ Environment Requirements
- ๐ง Installation
- ๐ฆ Model Checkpoints
- ๐ป Running Scripts
- ๐ Update Logs
- ๐ Citation
- ๐ Acknowledgements
- Limitation
- ๐ License
- ๐ฌ Contact
- ๐ Star History
๐ Environment Requirements
IC-Custom has been implemented and tested on:
- CUDA 12.4
- PyTorch 2.6.0
- Python 3.10.16
๐ง Installation
-
Clone the repository
bashgit clone https://github.com/TencentARC/IC-Custom.git cd IC-Custom -
Set up Python environment
bashconda create -n ic-custom python=3.10 -y conda activate ic-custom pip install -e . pip install -r requirements.txt -
Custom CUDA versions (optional)
If you require a different CUDA version, you can ignore the torch-related packages listed inrequirements.txt. Instead, please install PyTorch and xformers that are compatible with your CUDA version by following the instructions on the official PyTorch website.Example for CUDA 12.4:
bashpip3 install xformers torch==2.5.0 torchvision==0.20.0 torchaudio==2.5.0 --index-url https://download.pytorch.org/whl/cu124 -
Flash Attention 2 (optional)
If your device supports Flash Attention 2, you can optionally install flash-attn. We use flash-attn==2.7.3. Find compatible versions at flash-attention releases.
๐ฆ Model Checkpoints
You'll need to obtain the model checkpoints before running the inference or app.
- Option 1 โ Automatic download: checkpoints are fetched when running scripts (requires valid
HF_TOKEN). - Option 2 โ Manual download: use the helper script and then set paths in configs.
bashsh scripts/inference/download_models.sh $HF_TOKEN
Expected directory structure (example):
|-- models
|-- clip-vit-large-patch14
|-- ic-custom
| |-- dit_boundary_embeddings_0x1561.safetensors
| |-- dit_lora_0x1561.safetensors
| |-- dit_task_register_embeddings_0x1561.safetensors
| |-- dit_txt_img_in_0x1561.safetensors
| ...
|-- siglip-so400m-patch14-384
|-- t5-v1_1-xxl
|-- ae.safetensors
|-- flux1-fill-dev.safetensors
|-- flux1-redux-dev.safetensors
After manual download, edit the YAMLs in configs/** (e.g., inference.yaml) to point to your local model paths.
- A compact per-model list with links is available in
MODEL_CARD.md.
๐ป Running Scripts
App (Gradio Interface)
When running the app, all required models are automatically downloaded. Optional models are fetched only when explicitly enabled.
bashsh src/app/run_app.sh $HF_TOKEN $HF_CACHE_DIR
For required vs optional models and configuration, see APP.md.
Inference
Run the inference script with your Hugging Face token:
bashsh scripts/inference/inference.sh $HF_TOKEN $HF_CACHE_DIR
Parameters:
$HF_TOKEN: Your Hugging Face access token (required for automatic model download, optional if model paths are specified inconfigs/**/*.yaml)$HF_CACHE_DIR(optional): Custom cache directory for downloaded models (default: "~/.cache/huggingface/hub")
๐ Update Logs
- 2025/07/03 - Released paper, webpage.
- 2025/08/26 - Released Checkpoint v0x1561, APP, and Inference Code.
- TBD - Test and Training Code.
- TBD - A stronger model version.
๐ Citation
bibtex@article{li2025ic, title={IC-Custom: Diverse Image Customization via In-Context Learning}, author={Li, Yaowei and Li, Xiaoyu and Zhang, Zhaoyang and Bian, Yuxuan and Liu, Gan and Li, Xinyuan and Xu, Jiale and Hu, Wenbo and Liu, Yating and Li, Lingen and others}, journal={arXiv preprint arXiv:2507.01926}, year={2025} }
๐ Acknowledgements
We gratefully acknowledge the use of code from:
We also thank Hugging Face for providing professional model hosting and Spaces for deployment.
Limitation
Current limitations are mainly inference speed and the need for more flexible instruction following. We plan to improve these aspects in future updates. If you have any feedback, please feel free to contact us.
๐ License
We are pleased to support the open source community. For complete license details, see LICENSE and NOTICE.
๐ฌ Contact
For any questions, feel free to email.
๐ Star History
<p align="center"> <a href="https://star-history.com/#TencentARC/IC-Custom" target="_blank"> <img width="500" src="https://api.star-history.com/svg?repos=TencentARC/IC-Custom&type=Date" alt="Star History Chart"> </a> </p>Contributors
Showing top 2 contributors by commit count.
