IC-Custom Application

September 1, 2025 ยท View on GitHub

A sophisticated image customization tool powered by advanced AI models.

๐Ÿ“บ App Guide:
For a fast overview of how to use the app, watch this video:
IC-Custom App Usage Guide (YouTube)


๐Ÿš€ Quick Start

if [ -z "$HF_TOKEN" ] && [ -z "$HF_CACHE_DIR" ] && [ -z "$ASSETS_CACHE_DIR" ]; then
    python src/app/app.py \
        --config configs/app/app.yaml \
        --save_results \
        --enable_ben2_for_mask_ref \
        --enable_vlm_for_prompt \
else
    python src/app/app.py \
        --config configs/app/app.yaml \
        --hf_token $HF_TOKEN \
        --hf_cache_dir $HF_CACHE_DIR \
        --assets_cache_dir $ASSETS_CACHE_DIR \
        --save_results \
        --enable_ben2_for_mask_ref \
        --enable_vlm_for_prompt \
fi


โš™๏ธ Configuration & CLI Arguments

ArgumentTypeRequiredDefaultDescription
--configstrโœ…-Path to app YAML config file
--hf_tokenstrโŒ-Hugging Face access token.
--hf_cache_dirstrโŒ~/.cache/huggingface/hubHF assets cache directory
--assets_cache_dirstrโŒresults/appOutput images & metadata directory
--save_resultsboolโŒFalseSave generated results
--enable_ben2_for_mask_refboolโŒFalseEnable BEN2 background removal
--enable_vlm_for_promptboolโŒFalseEnable VLM prompt generation

Environment Variables

  • HF_TOKEN โ† --hf_token
  • HF_HUB_CACHE โ† --hf_cache_dir

๐Ÿ“ฅ Model Downloads

Model checkpoints are required before running the app.
All required models will be automatically downloaded when you run the app, or you can manually download them and specify paths in configs/app/app.yaml.

Required Models

The following models are automatically downloaded when running the app:

ModelPurposeSource
IC-CustomOur customization modelTencentARC/IC-Custom
CLIPVision-language understandingopenai/clip-vit-large-patch14
T5Text processinggoogle/t5-v1_1-xxl
SigLIPImage understandinggoogle/siglip-so400m-patch14-384
AutoencoderImage encoding/decodingblack-forest-labs/FLUX.1-Fill-dev
DITDiffusion modelblack-forest-labs/FLUX.1-Fill-dev
ReduxImage processingblack-forest-labs/FLUX.1-Redux-dev
SAM-vit-hImage segmentationHCMUE-Research/SAM-vit-h

Optional Models (Selective Download)

BEN2 and Qwen2.5-VL models are disabled by default and only downloaded when explicitly enabled:

ModelFlagSourcePurpose
BEN2--enable_ben2_for_mask_ref TruePramaLLC/BEN2Background removal
Qwen2.5-VL--enable_vlm_for_prompt TrueQwen/Qwen2.5-VL-7B-InstructPrompt generation

Manual Configuration

Alternative: Manually download all models and specify paths in configs/app/app.yaml:

checkpoint_config:
  # Required models
  dit_path: "/path/to/flux1-fill-dev.safetensors"
  ae_path: "/path/to/ae.safetensors"
  t5_path: "/path/to/t5-v1_1-xxl"
  clip_path: "/path/to/clip-vit-large-patch14"
  siglip_path: "/path/to/siglip-so400m-patch14-384"
  redux_path: "/path/to/flux1-redux-dev.safetensors"
  # IC-Custom models
  lora_path: "/path/to/dit_lora_0x1561.safetensors"
  img_txt_in_path: "/path/to/dit_txt_img_in_0x1561.safetensors"
  boundary_embeddings_path: "/path/to/dit_boundary_embeddings_0x1561.safetensors"
  task_register_embeddings_path: "/path/to/dit_task_register_embeddings_0x1561.safetensors"
  # APP interactive models
  sam_path: "/path/to/sam_vit_h_4b8939.pth"
  # Optional models
  ben2_path: "/path/to/BEN2_Base.pth"
  vlm_path: "/path/to/Qwen2.5-VL-7B-Instruct"

APP Overview

IC-Custom APP