File size: 2,826 Bytes
71d78b8
 
ad1cb61
 
71d78b8
 
 
 
 
 
 
ad1cb61
 
 
 
 
 
 
 
 
71d78b8
 
107aaf2
 
 
 
 
 
ad1cb61
107aaf2
ad1cb61
107aaf2
 
 
71d78b8
107aaf2
 
71d78b8
 
107aaf2
 
71d78b8
 
 
107aaf2
 
 
ad1cb61
107aaf2
71d78b8
107aaf2
 
 
 
71d78b8
ad1cb61
107aaf2
ad1cb61
107aaf2
 
 
ad1cb61
107aaf2
ad1cb61
 
 
71d78b8
 
107aaf2
 
 
 
71d78b8
107aaf2
71d78b8
107aaf2
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
---
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.