Instructions to use nebulette/aniportrait-lfm-350m with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use nebulette/aniportrait-lfm-350m with Diffusers:
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] - Notebooks
- Google Colab
- Kaggle
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
- -
Model tree for nebulette/aniportrait-lfm-350m
Base model
LiquidAI/LFM2.5-350M-Base