Instructions to use pranamjain/my-text-image-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use pranamjain/my-text-image-model with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("stable-diffusion-v1-5/stable-diffusion-v1-5", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("pranamjain/my-text-image-model") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
Pokémon Text-to-Image LoRA
A LoRA adapter fine-tuned on Stable Diffusion v1.5 for Pokémon-themed text-to-image generation.
Model Details
| Property | Value |
|---|---|
| Base model | Stable Diffusion v1.5 |
| Fine-tuning | LoRA |
| LoRA rank | 8 |
| Trainable parameters | 1,594,368 |
| Training epochs | 5 |
| Learning rate | 1e-4 |
| Batch size | 1 |
| Training examples | 833 |
| Resolution | 512 × 512 |
| Training steps | 4,165 |
Dataset
The model was trained using the pranamjain/pokemon-blip-captions dataset.
The dataset contains Pokémon images paired with text captions.
Training
The base VAE, text encoder, and original UNet parameters were frozen during training.
LoRA adapters were inserted into the following UNet attention layers:
to_kto_qto_vto_out.0
Only the LoRA parameters were optimized.
The model completed 5 epochs over 833 training examples per epoch.
Usage
import torch
from diffusers import StableDiffusionPipeline
base_model = "stable-diffusion-v1-5/stable-diffusion-v1-5"
lora_model = "pranamjain/my-text-image-model"
pipe = StableDiffusionPipeline.from_pretrained(
base_model,
torch_dtype=torch.float16
).to("cuda")
pipe.load_lora_weights(lora_model)
prompt = "a cute Pokemon character standing in a magical forest"
image = pipe(
prompt,
num_inference_steps=30,
guidance_scale=7.5
).images[0]
image.save("generated.png")
- Downloads last month
- 4
Model tree for pranamjain/my-text-image-model
Base model
stable-diffusion-v1-5/stable-diffusion-v1-5