Views
No views yet
pppppppspip install diffusers --upgradepip install invisible_watermark transformers accelerate safetensors1import torch
2from diffusers import DiffusionPipeline, AutoencoderKL
3device = "cuda" if torch.cuda.is_available() else "cpu"
4vae = AutoencoderKL.from_pretrained('madebyollin/sdxl-vae-fp16-fix', torch_dtype=torch.float16)
5pipe = DiffusionPipeline.from_pretrained(
6 "stabilityai/stable-diffusion-xl-base-1.0",
7 vae=vae, torch_dtype=torch.float16, variant="fp16",
8 use_safetensors=True
9)
10pipe.to(device)
11# This is where you load your trained weights
12specific_safetensors = "pytorch_lora_weights.safetensors"
13lora_scale = 0.9
14pipe.load_lora_weights(
15 'ClaireOzzz/ppppppps',
16 weight_name = specific_safetensors,
17 # use_auth_token = True
18)
19prompt = "A majestic ppppppps jumping from a big stone at night"
20image = pipe(
21 prompt=prompt,
22 num_inference_steps=50,
23 cross_attention_kwargs={"scale": lora_scale}
24).images[0]