anima-v1-duplicate / README.md
ASomeoneWhoInterestedWithAI's picture
Update README.md
694e888 verified
|
Raw
History Blame Contribute Delete
4.14 kB
---
title: Anima V1 CPU Demo
emoji: 🎨
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: 5.44.1
app_file: app.py
pinned: false
license: other
models:
- circlestone-labs/Anima
tags:
- text-to-image
- anima
- zerogpu
- gradio
- anime
---
# Anima V1 CPU Demo
A Hugging Face Gradio Space demo for the **Anima V1 base release**.
This demo intentionally **does not** load an old Preview Diffusers repo. It uses the current V1 split files from `circlestone-labs/Anima`:
- `split_files/diffusion_models/anima-base-v1.0.safetensors`
- `split_files/text_encoders/qwen_3_06b_base.safetensors`
- `split_files/vae/qwen_image_vae.safetensors`
It uses `DiffSynth-Studio` for the actual Anima single-file loader because the upstream Anima repo is published in ComfyUI / Diffusion Single File format rather than as a native Diffusers `model_index.json` pipeline.
## Deploy
1. Create a new Hugging Face Space.
2. Choose **Gradio** as the SDK.
3. Upload these files.
4. In **Settings → Hardware**, select **CPU**.
5. Optional but recommended: enable persistent storage so the model download is cached between restarts.
## Startup behavior
The app downloads the required model/tokenizer files from **Hugging Face Hub** during application startup with `huggingface_hub`:
- Anima diffusion model, text encoder, and VAE from `circlestone-labs/Anima`
- Qwen tokenizer files from `Qwen/Qwen3-0.6B`
- T5 tokenizer files from the public `google/t5-v1_1-xxl` repo
The app then tries to load the Anima pipeline at module startup. This matches Hugging Face ZeroGPU guidance: GPU functions are decorated with `@spaces.GPU`, but large models should still be placed on `cuda` at the root module level rather than lazy-loaded inside the generation function. After a successful startup load, **Generate** reuses the same in-memory pipeline for that running Space process. If the startup load fails, **Generate** retries as a fallback and then reuses the loaded pipeline after a successful load.
## Why it should not download from ModelScope
DiffSynth-Studio defaults to ModelScope for remote model resolution. This demo sets `DIFFSYNTH_DOWNLOAD_SOURCE=huggingface`, pre-downloads assets with `huggingface_hub`, validates the local tokenizer directories, and passes local file paths to `ModelConfig(path=...)`, so generation should not trigger ModelScope downloads.
The T5 tokenizer no longer depends on the gated `stabilityai/stable-diffusion-3.5-large` repo or any SD3.5 mirror. If you override `ANIMA_T5_TOKENIZER_ID` to a mirror that does not contain usable tokenizer files, the app falls back to `google/t5-v1_1-xxl`.
The app stores files under `/data/models/anima-v1` when persistent storage is writable, otherwise `/tmp/models/anima-v1`.
## Configuration
Environment variables:
| Variable | Default |
|---|---|
| `ANIMA_MODEL_ID` | `circlestone-labs/Anima` |
| `ANIMA_DIFFUSION_FILE` | `split_files/diffusion_models/anima-base-v1.0.safetensors` |
| `ANIMA_TEXT_ENCODER_FILE` | `split_files/text_encoders/qwen_3_06b_base.safetensors` |
| `ANIMA_VAE_FILE` | `split_files/vae/qwen_image_vae.safetensors` |
| `ANIMA_QWEN_TOKENIZER_ID` | `Qwen/Qwen3-0.6B` |
| `ANIMA_T5_TOKENIZER_ID` | `google/t5-v1_1-xxl` |
| `ANIMA_T5_TOKENIZER_SUBFOLDER` | unset / empty |
| `ANIMA_T5_TOKENIZER_FALLBACK_ID` | `google/t5-v1_1-xxl` |
| `ANIMA_LOCAL_MODEL_DIR` | `/data/models/anima-v1`, fallback `/tmp/models/anima-v1` |
| `ANIMA_LOAD_AT_STARTUP` | `1` |
| `ANIMA_VRAM_LIMIT_GB` | unset |
## Why not `DiffusionPipeline.from_pretrained(...)`?
The upstream V1 repo provides single-file ComfyUI-style weights, not a native Diffusers folder with `model_index.json`, split component configs, and already-converted component state dicts. A pure Diffusers Space becomes straightforward once a V1 Diffusers conversion exists. Until then, this Space avoids stale preview repos and loads the V1 files directly.
## License
The Anima model is under the CircleStone Labs Non-Commercial License and is also subject to NVIDIA's Open Model License Agreement insofar as it applies to derivative models. Review the upstream model card before deploying or sharing outputs.