Downloads · 30 days
2
29% of all-time downloads
Aksh16/Text_to_img
Text_to_img is a text-to-image model from Aksh16. Use it when you need an image from a text prompt. It is set up for peft. The card lists the license as mit.
This repository hosts a LoRA fine-tuned version of the runwayml/stable-diffusion-v1-5 model for text-to-image generation using the peft and diffusers libraries. The model has been fine-tuned on custom captioned image…
Downloads · 30 days
2
29% of all-time downloads
All-time downloads
7
Public
Repo size
3.4 GB
Likes
0
Public
Click a slice to open those files.
.safetensors3.4 GB · 100%
From the Hugging Face model README
This repository hosts a LoRA fine-tuned version of the runwayml/stable-diffusion-v1-5 model for text-to-image generation using the peft and diffusers libraries. The model has been fine-tuned on custom captioned image datasets, resized to 512x512 resolution, and optimized for generating high-quality images from textual prompts.
runwayml/stable-diffusion-v1-5)Below is a sample code snippet showing how to load and use the model:
from diffusers import StableDiffusionPipeline
from peft import PeftModel
import torch
# Load base pipeline
pipe = StableDiffusionPipeline.from_pretrained(
"runwayml/stable-diffusion-v1-5",
torch_dtype=torch.float16
).to("cuda")
# Load the LoRA fine-tuned adapter
pipe.unet = PeftModel.from_pretrained(
pipe.unet,
"Aksh16/Text_to_img" # Replace with your actual Hugging Face repo path
).to("cuda")
# Generate image from prompt
prompt = "A magical landscape with glowing mushrooms and waterfalls"
image = pipe(prompt).images[0]
# Save the output
image.save("output.png")