Anima-Lightning / README.md
aina-tech's picture
update readme
9dbb6e1 verified
|
Raw History Blame Contribute Delete
2.83 kB
---
base_model:
- circlestone-labs/Anima
- nvidia/Cosmos-Predict2-2B-Text2Image
base_model_relation: finetune
license: other
license_name: circlestone-labs-non-commercial-license
license_link: LICENSE.md
library_name: diffusers
pipeline_tag: text-to-image
tags:
- text-to-image
- diffusers
- anime
- illustration
- anima
- cosmos
- qwen3
- distilled
- 4-step
---
This update replaces the earlier checkpoint and its shift-1 inference recipe.
Use **4 steps, CFG 1, scheduler shift 3**, with raw sigmas `[1, .75, .5, .25]`.
The scheduler applies the shift once, producing `[1, .9, .75, .5, 0]`.
The included custom transformer defaults to K=4 conditioning. A plain
`CosmosTransformer3DModel` cannot load the full checkpoint correctly: it would drop
the learned K branch. Use the supplied module as shown below.
## Local loading and generation
Requires PyTorch with CUDA/BF16, Diffusers with Anima modular support, Transformers,
Accelerate and Safetensors. Validated environment: Diffusers 0.39.0,
Transformers 5.7.0 and PyTorch 2.12.1+cu130.
Download the complete repository with `hf download aina-tech/Anima-Lightning --local-dir Anima-Lightning`.
Review the included Python module before importing it.
```python
from pathlib import Path
import sys
import torch
from diffusers import AnimaModularPipeline
local = str(Path("Anima-Lightning").resolve())
sys.path.insert(0, local)
import anima_lightning_transformer
pipe = AnimaModularPipeline.from_pretrained(local, local_files_only=True)
pipe.load_components(
["text_encoder", "tokenizer", "t5_tokenizer", "text_conditioner",
"transformer", "scheduler", "vae"],
pretrained_model_name_or_path=local,
local_files_only=True, torch_dtype=torch.bfloat16,
)
pipe.guider.guidance_scale = 1.0
pipe.to("cuda")
image = pipe(
prompt="anime illustration, a lighthouse above a calm sea, sunset",
negative_prompt=None, width=1024, height=1024,
num_inference_steps=4, sigmas=[1.0, 0.75, 0.5, 0.25],
max_sequence_length=512,
generator=torch.Generator(device="cpu").manual_seed(42),
output="images",
)[0]
image.save("anima_lightning.png")
```
Do not use the former shift-1 recipe or standard full-step CFG5 inference.
The saved transformer tensors are BF16; results can differ from the FP32 checkpoint
and from other sampling implementations. `step400_export.json` records source hashes,
the complete tensor inventory, and the BF16 export validation.
## Model and license
Derived from CircleStone Labs Anima and NVIDIA Cosmos Predict2. This is an independent
distilled release, intended for anime and illustration. Anatomy, complex compositions,
and text rendering can be imperfect. See the unchanged `LICENSE.md` and `NOTICE.md`.
The CircleStone Labs non-commercial license and applicable upstream terms remain in effect.