InstantRetouch / README.md
iimmortall's picture
Deploy InstantRetouch IP2P-BILA ZeroGPU Space
860c112 verified
---
title: InstantRetouch
sdk: gradio
sdk_version: "4.44.1"
python_version: "3.10"
app_file: app.py
pinned: false
license: other
---
# InstantRetouch / IP2P-BiLA Demo
Public Hugging Face ZeroGPU demo for instruction-guided image retouching with the validation-selected IP2P/BiLA checkpoint.
- Model: IP2P/BiLA
- UI: image upload, optional instruction, seed, max side, strength, and selectable examples
This Space is isolated from the research repository. It does not import `agent/`, training scripts, or local experiment paths at runtime. Weights live in a separate Hugging Face model repo and are downloaded lazily through `BILA_WEIGHTS_REPO`.
## Required Space Variables
Set one of these in the Space environment:
- `BILA_WEIGHTS_REPO`: Hugging Face model repo containing the IP2P weight layout below.
- `BILA_MODEL_ROOT`: local path with the same layout, useful only for staging/debugging.
Optional:
- `HF_TOKEN`: required if `BILA_WEIGHTS_REPO` is private.
- `BILA_MODEL_CACHE`: cache location. If unset, the app uses `/data/bila-space-demo/hf-cache` when persistent storage exists, otherwise `/tmp/bila-space-demo/hf-cache`.
## Weight Repo Layout
Do not commit weights into this Space repo. Put them in a separate HF model repo:
```text
ip2p/
base/
tokenizer/
text_encoder/
vae/
unet/
checkpoints/
<bila-checkpoint>.pth
metrics/
<metric-summary>.json
```
The app follows the validation-style direct flow: load the IP2P base model, load the BiLA checkpoint named in `model_manifest.json`, generate `bila_output`, then apply strength as `input + strength * (bila_output - input)`.