Views
No views yet
ComfyUI support: SimpleTuner-io/ComfyUI-AnyFlow is the canonical AnyFlow ComfyUI integration and ships with a ready-made workflow for Anima few-step inference.
checkpoint-10000/ema (the lr-6e-5 arm that reached stage1-v1's 20k EMA bar in half the
steps), using the EMA configuration that won the v1-v4 ablation grid — per-step updates
with ema_decay: 0.99 — and caption dropout disabled. Same objective as the grid
(on-policy DMD + co-trained forward, real score CFG 3.0, lr 2e-6, 1,500 steps, global
batch 16, 65,536-sample e621 subset).masterpiece, best quality, score_7, safe, anime portrait of a young woman with blue hair wearing a white jacket, clean line art, detailed eyes, soft daylight1.00.04AnyFlowValidationScheduler (FlowMatchEulerDiscreteScheduler)421024x1024no_change1import torch
2from diffusers import DiffusionPipeline
3
4model_id = 'circlestone-labs/Anima-Base-v1.0-Diffusers'
5adapter_id = 'bghira/anima-anyflow-e621-dmd-v5'
6pipeline = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16) # loading directly in bf16
7pipeline.load_lora_weights(adapter_id)
8
9prompt = "masterpiece, best quality, score_7, safe, anime portrait of a young woman with blue hair wearing a white jacket, clean line art, detailed eyes, soft daylight"
10negative_prompt = 'worst quality, low quality, score_1, score_2, score_3, blurry, cropped, artist name, signature'
11
12## Optional: quantise the model to save on vram.
13## Note: The model was not quantised during training, so it is not necessary to quantise it during inference time.
14#from optimum.quanto import quantize, freeze, qint8
15#quantize(pipeline.transformer, weights=qint8)
16#freeze(pipeline.transformer)
17
18pipeline.to('cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu') # the pipeline is already in its target precision level
19model_output = pipeline(
20 prompt=prompt,
21 negative_prompt=negative_prompt,
22 num_inference_steps=4,
23 generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(42),
24 width=1024,
25 height=1024,
26 guidance_scale=1.0,
27).images[0]
28
29model_output.save("output.png", format="PNG")
30