diffusers-anima provides an Anima pipeline implementation designed to align with Diffusers patterns.
pip install git+https://github.com/hdae/diffusers-anima.gitOr with uv:
uv add git+https://github.com/hdae/diffusers-anima.gitimport torch
from diffusers_anima import AnimaPipeline
pipe = AnimaPipeline.from_pretrained(
"hdae/diffusers-anima-preview",
torch_dtype=torch.bfloat16,
)
pipe.to("cuda")
result = pipe(
"masterpiece, best quality, score 9, score 8, newest, absurdres, very aesthetic, highres, 1girl, solo, long hair, blue eyes, white blouse, pleated skirt, looking at viewer, gentle smile, smiling",
negative_prompt="worst quality, low quality, score_1, score_2, score_3, monochrome, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, normal quality, jpeg artifacts, nsfw, nude, nipples, areola, cleavage, breasts, large breasts, suggestive, erotic, explicit",
width=1024,
height=1024,
num_inference_steps=32,
guidance_scale=4.0,
generator=torch.Generator(device="cpu").manual_seed(42),
)
result.images[0].save("output.png")pipe = AnimaPipeline.from_single_file("/path/to/anima.safetensors")from PIL import Image
init_image = Image.open("input.png").convert("RGB")
mask_image = Image.open("mask.png").convert("L") # white = repaint area
# Img2Img:
result = pipe(
"masterpiece, best quality, score 9, score 8, newest, absurdres, very aesthetic, highres, 1girl, solo, long hair, blue eyes, white blouse, pleated skirt, looking at viewer, gentle smile, smiling",
negative_prompt="worst quality, low quality, score_1, score_2, score_3, monochrome, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, normal quality, jpeg artifacts, nsfw, nude, nipples, areola, cleavage, breasts, large breasts, suggestive, erotic, explicit",
image=init_image,
strength=0.65,
width=1024,
height=1024,
num_inference_steps=32,
guidance_scale=4.0,
)
# Inpaint:
result = pipe(
"masterpiece, best quality, score 9, score 8, newest, absurdres, very aesthetic, highres, 1girl, solo, long hair, blue eyes, white blouse, pleated skirt, looking at viewer, gentle smile, smiling",
negative_prompt="worst quality, low quality, score_1, score_2, score_3, monochrome, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, normal quality, jpeg artifacts, nsfw, nude, nipples, areola, cleavage, breasts, large breasts, suggestive, erotic, explicit",
image=init_image,
mask_image=mask_image,
strength=0.75,
width=1024,
height=1024,
num_inference_steps=32,
guidance_scale=4.0,
)pipe.load_lora_weights("/path/to/lora.safetensors", adapter_name="style")
pipe.set_adapters("style", adapter_weights=[0.8])
result = pipe(
"masterpiece, best quality, score 9, score 8, newest, absurdres, very aesthetic, highres, 1girl, solo, long hair, blue eyes, white blouse, pleated skirt, looking at viewer, gentle smile, smiling",
negative_prompt="worst quality, low quality, score_1, score_2, score_3, monochrome, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, normal quality, jpeg artifacts, nsfw, nude, nipples, areola, cleavage, breasts, large breasts, suggestive, erotic, explicit",
width=1024,
height=1024,
)Model weights are hosted on HuggingFace: hdae/diffusers-anima-preview
The Anima model was developed by CircleStone Labs and Comfy Org. The weights are based on circlestone-labs/Anima and are subject to the CircleStone Labs Non-Commercial License. The model weights may not be used for commercial purposes. Generated outputs may be used for any purpose.
This code library (diffusers-anima) is separately licensed under Apache 2.0.
| Document | Description |
|---|---|
docs/api.md |
Full API reference (loading, generation, sampling config) |
docs/development.md |
Development setup, test commands, project structure |
docs/custom_implementations.md |
Intentional deviations from Diffusers upstream |