Run this model with HF Jobs

Run tonera/NovaAnimeAM-Nunchaku on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/tonera/NovaAnimeAM-Nunchaku. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/tonera/NovaAnimeAM-Nunchaku on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

NovaAnimeAM W8A8 (SVDQuant)

Language: English | ไธญๆ–‡

INT8 weight-and-activation quantization of the NovaAnimeAM transformer, for inference with Nunchaku. Text encoders and the VAE stay in BF16.

Model

Anima is a 2B text-to-image model from CircleStone Labs and Comfy Org, aimed at anime and illustration. NovaAnimeAM uses the same pipeline. This checkpoint was tested at 40 steps and CFG 4.5.

The checkpoint quantizes 400 transformer linears to W8A8: signed INT8 weights with one scale per output channel, and dynamic per-row INT8 activations. Rank is 0, so there is no low-rank branch. Embeddings, AdaLN, and proj_out stay in BF16.

Samples

1024ร—1024, 40 steps, CFG 4.5. In each pair, the left image is BF16 and the right image is W8A8.

masterpiece, best quality, score_7, safe, 2girls, wide shot, full body, shrine, standing, pointing, holding ofuda, fingers, kimono, outdoors, daytime

BF16 W8A8
BF16 W8A8

masterpiece, best quality, 1girl is holding a sign that says: CreatePPTX.com

BF16 W8A8
BF16 W8A8

Performance

BF16 pipeline vs this W8A8 transformer. 1024ร—1024, CFG 4.5, 40 steps, bfloat16. Steady time is one run after a warmup.

BF16 W8A8 Quantized vs BF16
Load 5.818s 4.798s 1.21ร—
Cold inference 14.670s 11.674s 1.26ร—
Steady inference 14.222s 11.213s 1.27ร—
Allocated after load 6.87 GiB 4.50 GiB 2.37 GiB less (34.5%)
Peak allocated during inference 11.01 GiB 8.67 GiB 2.34 GiB less (21.2%)

nvidia-smi process memory after load drops from 7.42 GiB to 5.13 GiB, 2.29 GiB less (30.9%).

Install

Anima W8A8 needs a Nunchaku build that provides NunchakuAnimaTransformer3DModel. Install nunchaku-1.4.0+cu13.0torch2.11-cp311-cp311-linux_x86_64.whl from tonera/vitoom-nunchaku, and a Diffusers build that includes AnimaModularPipeline.

pip install "git+https://github.com/huggingface/diffusers.git"

pip install torch==2.11.* torchvision==0.26.* torchaudio==2.11.* \
  --index-url https://download.pytorch.org/whl/cu130

hf download tonera/vitoom-nunchaku \
  nunchaku-1.4.0+cu13.0torch2.11-cp311-cp311-linux_x86_64.whl \
  --local-dir ./wheels

pip install ./wheels/nunchaku-1.4.0+cu13.0torch2.11-cp311-cp311-linux_x86_64.whl

This wheel is Python 3.11, CUDA 13.0, PyTorch 2.11, Linux x86_64. Other platforms are listed in the vitoom-nunchaku model card.

python -c "from nunchaku import NunchakuAnimaTransformer3DModel; print('ok')"

Usage

guidance_scale is stored on guider. Do not pass it into pipe(...). This example uses scale 4.5 and 40 steps. The component list below skips the BF16 transformer so it is never loaded. from_pretrained(..., device="cuda") packs the plain INT8 weights for the kernel and moves the unpacked copies off the GPU.

import torch
from diffusers import AnimaModularPipeline
from diffusers.guiders import ClassifierFreeGuidance
from nunchaku import NunchakuAnimaTransformer3DModel

REPO = "tonera/NovaAnimeAM-Nunchaku"

pipe = AnimaModularPipeline.from_pretrained(REPO)
pipe.load_components(
    [
        "text_encoder",
        "tokenizer",
        "t5_tokenizer",
        "text_conditioner",
        "scheduler",
        "vae",
    ],
    torch_dtype=torch.bfloat16,
)
pipe.update_components(guider=ClassifierFreeGuidance(guidance_scale=4.5))

transformer = NunchakuAnimaTransformer3DModel.from_pretrained(
    f"{REPO}/svdq-int8_r0-NovaAnimeAM-Nunchaku.safetensors",
    torch_dtype=torch.bfloat16,
    device="cuda",
)
pipe.update_components(transformer=transformer)
pipe.to("cuda")

image = pipe(
    prompt="masterpiece, best quality, score_7, safe, 2girls, wide shot, full body, shrine, standing, pointing, holding ofuda, fingers, kimono, outdoors, daytime",
    height=1024,
    width=1024,
    num_inference_steps=40,
    generator=torch.Generator(device="cuda").manual_seed(42),
).images[0]
image.save("novaanimeam-w8a8.png")

License

This quantization is a derivative of circlestone-labs/Anima. Weights follow the CircleStone Labs Non-Commercial License. Anima is also a derivative of NVIDIA Cosmos-Predict2-2B-Text2Image, so the NVIDIA Open Model License applies where that agreement covers derivative models. Generated images are not under the non-commercial restriction. See the upstream model card for commercial-use examples and the contact for a commercial license.

Downloads last month
35
Safetensors
Model size
3B params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for tonera/NovaAnimeAM-Nunchaku

Quantized
(76)
this model

Collection including tonera/NovaAnimeAM-Nunchaku