imomayiz/morocco-img
Viewer • Updated • 49 • 75 • 2
How to use imomayiz/moroccan_sdxl_lora with Diffusers:
pip install -U diffusers transformers accelerate
import torch
from diffusers import DiffusionPipeline
# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("imomayiz/moroccan_sdxl_lora", dtype=torch.bfloat16, device_map="cuda")
prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
image = pipe(prompt).images[0]The weights were trained using DreamBooth.
VAE used for training: madebyollin/sdxl-vae-fp16-fix.
You should use "modern moroccan city" to trigger the image generation.
Weights for this model are available here.
The training images can be found here.
import torch
from diffusers import DiffusionPipeline, AutoencoderKL
repo_id = "imomayiz/moroccan_sdxl_lora"
# load lora weights and pipeline
vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
pipe = DiffusionPipeline.from_pretrained(
"stabilityai/stable-diffusion-xl-base-1.0",
vae=vae,
torch_dtype=torch.float16,
variant="fp16",
use_safetensors=True
)
pipe.load_lora_weights(repo_id)
_ = pipe.to("cuda")
prompt = "a photo of a modern moroccan city"
# generate the image
image = pipe(prompt=prompt, num_inference_steps=30).images[0]
image
Base model
stabilityai/stable-diffusion-xl-base-1.0