Views
No views yet
hshge, hamster4.20.020None421024x10241import torch
2from diffusers import DiffusionPipeline
3
4model_id = 'stabilityai/stable-diffusion-xl-base-1.0'
5adapter_id = 'davidrd123/Hiroshige-SDXL-LoRA'
6pipeline = DiffusionPipeline.from_pretrained(model_id)
7pipeline.load_lora_weights(adapter_id)
8
9prompt = "hshge, hamster"
10negative_prompt = 'blurry, cropped, ugly'
11pipeline.to('cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu')
12image = pipeline(
13 prompt=prompt,
14 negative_prompt=negative_prompt,
15 num_inference_steps=20,
16 generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(1641421826),
17 width=1024,
18 height=1024,
19 guidance_scale=4.2,
20 guidance_rescale=0.0,
21).images[0]
22image.save("output.png", format="PNG")