Instructions to use nebulette/aniportrait-lfm with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use nebulette/aniportrait-lfm 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", 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
UNet
Flow matching (time_shift_type is 'linear') and the LFM2.5 text encoder on the top of Aniimage.
Due to the lack of training data, the only prompt it understands is anime portraits.
VAE
This release is an adaptation of the 8BitStudio's model for the 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.
There's the LFM2.5 encoder, which is great for those anime text sequences.
The learning rate was set to 1e-5 during the warmup phase, which had 200k images. Then it continued with a fixed image size until the handwritten code was confirmed to converge in later epochs.
For the second stage, the loss was calculated by the difference between the latent, the colored images and the grayscale/colored image pairs; in mixed-resolution image samples.
The timesteps were chosen by the logit-normal sampling.
Source data:
- anime_faces_256px_v2
- anime_style_portrait
- gelbooru (landscape)
- portraits_512
- wikiart_face
- Downloads last month
- 16
Model tree for nebulette/aniportrait-lfm
Base model
8BitStudio/Aniimage-2