Team Ai
Modelpublic

Shion1124/anime-character-lora_v1.5

sourceHugging Faceopenrailupdated 8mo agoView on Hugging Face
0likes11downloads
Model Card

anime-character-lora_v1.5

This repository provides a LoRA adapter fine-tuned from runwayml/stable-diffusion-v1-5 using PyTorch LoRA (PEFT).

This repository contains LoRA adapter weights only. The base model must be loaded separately.

Training Objective

This adapter is trained to improve anime character generation quality across 5 artistic styles (impressionist, soft-focus, oil painting, sketch, pastel).

The model learns style-specific features from Danbooru anime images, applied to the UNet attention layers (to_k, to_v, to_q, to_out.0).

Example Output

[image]

Training Configuration

  • —Base model: runwayml/stable-diffusion-v1-5
  • —Method: LoRA (PEFT)
  • —Target modules: to_k, to_v, to_q, to_out.0 (Attention Linear layers only)
  • —LoRA rank: 8
  • —LoRA alpha: 32.0
  • —Learning rate: 1e-4
  • —Batch size: 2
  • —Epochs: 10
  • —Final loss: 0.146112
  • —GPU: Colab T4 (16 GB VRAM)

Dataset

Danbooru anime images collected and classified into 5 styles:

StyleImages
impressionist_style~60
softfocuslandscape~60
oilpaintingaesthetic~60
sketch_aesthetic~60
pastel_softness~60

Total: ~300 images

Usage

python
import torch
from diffusers import StableDiffusionPipeline
from peft import PeftModel

base = "runwayml/stable-diffusion-v1-5"
adapter = "Shion1124/anime-character-lora_v1.5"

pipe = StableDiffusionPipeline.from_pretrained(base, torch_dtype=torch.float16)
pipe.unet = PeftModel.from_pretrained(pipe.unet, adapter, adapter_name="anime_lora")
pipe = pipe.to("cuda")

image = pipe(
    prompt="1girl, anime character, watercolor style, masterpiece, high quality",
    negative_prompt="low quality, blurry, distorted, nsfw",
    num_inference_steps=20,
    guidance_scale=7.5,
    height=512,
    width=512,
    generator=torch.Generator(device="cuda").manual_seed(42)
).images[0]
image.save("output.png")

Recommended Prompts

Anime character:

1girl, anime character, detailed beautiful face, long hair,
watercolor painting style, soft colors, bokeh background,
masterpiece, best quality, high quality, intricate details

Negative prompt:

low quality, worst quality, blurry, distorted, watermark,
error, nsfw, extra limbs, missing limbs, ugly, bad anatomy
ParameterValue
num_inference_steps20
guidance_scale7.5
height / width512 × 512

Sources & Terms (IMPORTANT)

Training data: Danbooru (https://danbooru.donmai.us/)

Dataset License: CC0 (Public Domain). Images sourced from Danbooru under CC0 terms. Compliance: Users must comply with the base model's original license terms (OpenRAIL-M).

License

ComponentLicense
Stable Diffusion v1.5OpenRAIL-M
LoRA adapter (this repo)Apache 2.0
Training data (Danbooru)CC0

References

  1. 1.Ho et al. (2020) - Denoising Diffusion Probabilistic Models - arXiv:2006.11239
  2. 2.Rombach et al. (2022) - High-Resolution Image Synthesis with Latent Diffusion Models - arXiv:2112.10752
  3. 3.Hu et al. (2021) - LoRA: Low-Rank Adaptation of Large Language Models - arXiv:2106.09685