File size: 648 Bytes
1cfa1c4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
from diffusers import StableDiffusionPipeline
import torch
import PIL
from IPython.display import display
# Load the base model
pipe = StableDiffusionPipeline.from_pretrained(
"runwayml/stable-diffusion-v1-5", # base model
torch_dtype=torch.float16,
).to("cuda")
# Load your LoRA
pipe.load_lora_weights("Flo444/example-lora-realistic")
# Fuse LoRA (optional: set strength 0.7 or whatever you want)
pipe.fuse_lora(lora_scale=0.7)
# Prompt
prompt = "beautiful realistic landscape, mountains, river"
# Generate
image = pipe(prompt, num_inference_steps=30, guidance_scale=7).images[0]
# Display the image directly in Colab
display(image) |