CoolFace
Modelpublic

kentarrito/stable-diffusion-2-kanji-finetune-lora

sourceHugging Facemitupdated 1y agoView on Hugging Face
0likes3downloads
Model Card

๐Ÿงพ Model Card: LoRA Fine-Tuned โ€“ kentarrito/stable-diffusion-2-kanji-finetune-lora

๐Ÿˆš Stable Diffusion 2 โ€“ Kanji Fine-Tune (LoRA)

This model is a LoRA fine-tuned version of Stable Diffusion 2, trained to generate kanji-like images based on their English meanings.

LoRA tuning allows lightweight updates to the base model, making it easier to combine with other LoRA modules or revert to base SD2.0.

๐Ÿ“ฆ Usage

python
from diffusers import StableDiffusionPipeline, UNet2DConditionModel
import torch
from peft import PeftModel

base_model = "stabilityai/stable-diffusion-2"
lora_model = "kentarrito/stable-diffusion-2-kanji-finetune-lora"

pipe = StableDiffusionPipeline.from_pretrained(
    base_model, torch_dtype=torch.float16
).to("cuda")

pipe.unet = PeftModel.from_pretrained(pipe.unet, lora_model)

image = pipe(prompt="peace").images[0]
image.show()
๐Ÿ”ง If using the LoRA manually, merge the LoRA weights into the UNet before generation.

๐Ÿ–ผ๏ธ Generated Samples

See Github

๐Ÿง  Dataset

See `kentarrito/kanji_dataset` Each image represents a kanji symbol and is paired with a corresponding English word.

๐ŸŽฏ Limitations

  • โ€”Not suitable for generating real kanji characters or fonts.
  • โ€”English words that do not map to a trained kanji may result in generic or failed outputs.

๐Ÿงช Training

  • โ€”Training Code Github
  • โ€”Base: stabilityai/stable-diffusion-2
  • โ€”Method: LoRA tuning of UNet only
  • โ€”Framework: Hugging Face diffusers + peft
  • โ€”LoRA Rank: 4

๐Ÿ“œ License

MIT License. Dataset sources follow KanjiVG and KANJIDIC2 licenses.