How to use from the
Use from the
Diffusers library
pip install -U diffusers transformers accelerate
import torch
from diffusers import DiffusionPipeline

# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("nebulette/aniportrait-lfm-350m", dtype=torch.bfloat16, device_map="cuda")

prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
image = pipe(prompt).images[0]

UNet

Flow matching (time_shift_type is 'linear') and the LFM2.5 text encoder on the top of an UNet model.

Mage-VAE

The UNet takes a 16x downsampled latent, which is smaller than SDXL thanks to the new autoencoder. The decoding is 5x faster than Flux.2 VAE.

Noise embeddings

Since modern LLM-backed image generation offers less variety than old UNet models, the initial noise was artificially restricted.

After the first step, a random noise is removed from the latent - similar to other models.

The optional padding/border around the images was not included in the loss calculation.

Text Encoder

The LFM2.5 encoder was used for those anime text sequences.

Layer-skipping

The model configuration made it possible to skip the up layers:

  • first the entire model was initialized with a low learning rate
  • then only the last 1, 2, 3, 4 up layers were trained
  • finally all weights were activated again

In the initial epochs, the model was exposed to larger image samples, which were augmented by image cropping.

The learning rate was set to 1e-5 during the warmup phase.

The timesteps were chosen by the logit-normal sampling.

Source data

  • anime_faces_v2
  • gelbooru_2026 (portraits)

References

  • 2606.03715
Downloads last month
-
Safetensors
Model size
76.4M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for nebulette/aniportrait-lfm-350m

Finetuned
(1)
this model