Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -41,11 +41,11 @@ if torch.cuda.is_available():
|
|
41 |
"madebyollin/sdxl-vae-fp16-fix",
|
42 |
torch_dtype=torch.float16
|
43 |
)
|
44 |
-
|
45 |
pipe.to(device)
|
46 |
print("Loaded on Device!")
|
47 |
-
|
48 |
-
|
49 |
if USE_TORCH_COMPILE:
|
50 |
pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True)
|
51 |
print("Model Compiled!")
|
@@ -87,7 +87,7 @@ def generate(
|
|
87 |
width=width,
|
88 |
height=height,
|
89 |
guidance_scale=guidance_scale,
|
90 |
-
num_inference_steps=
|
91 |
num_images_per_prompt=1,
|
92 |
output_type="pil",
|
93 |
).images
|
|
|
41 |
"madebyollin/sdxl-vae-fp16-fix",
|
42 |
torch_dtype=torch.float16
|
43 |
)
|
44 |
+
pipe.scheduler = KDPM2AncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
45 |
pipe.to(device)
|
46 |
print("Loaded on Device!")
|
47 |
+
pipe.load_lora_weights("stabilityai/stable-diffusion-xl-base-1.0", weight_name="sd_xl_offset_example-lora_1.0.safetensors")
|
48 |
+
pipe.fuse_lora(lora_scale=0.1)
|
49 |
if USE_TORCH_COMPILE:
|
50 |
pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True)
|
51 |
print("Model Compiled!")
|
|
|
87 |
width=width,
|
88 |
height=height,
|
89 |
guidance_scale=guidance_scale,
|
90 |
+
num_inference_steps=35,
|
91 |
num_images_per_prompt=1,
|
92 |
output_type="pil",
|
93 |
).images
|