Spaces:
Runtime error
Runtime error
kayfahaarukku
commited on
Remove safetensors variable and changing default resolution.
Browse files
app.py
CHANGED
@@ -14,7 +14,6 @@ pipe = StableDiffusionXLPipeline.from_pretrained(
|
|
14 |
"kayfahaarukku/UrangDiffusion-1.0",
|
15 |
torch_dtype=torch.float16,
|
16 |
custom_pipeline="lpw_stable_diffusion_xl",
|
17 |
-
use_safetensors=True,
|
18 |
)
|
19 |
pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
20 |
|
@@ -48,7 +47,6 @@ def generate_image(prompt, negative_prompt, use_defaults, resolution, guidance_s
|
|
48 |
).images[0]
|
49 |
|
50 |
torch.cuda.empty_cache()
|
51 |
-
pipe.to('cpu') # Move the model back to CPU after generation
|
52 |
|
53 |
return image, seed
|
54 |
|
@@ -75,7 +73,7 @@ with gr.Blocks(title="UrangDiffusion 1.0 Demo", theme="NoCrypt/[email protected]") as d
|
|
75 |
"1344x768", "768x1344", "1536x640", "640x1536"
|
76 |
],
|
77 |
label="Resolution",
|
78 |
-
value="
|
79 |
)
|
80 |
guidance_scale_input = gr.Slider(minimum=1, maximum=20, step=0.5, label="Guidance Scale", value=7)
|
81 |
num_inference_steps_input = gr.Slider(minimum=1, maximum=100, step=1, label="Number of Inference Steps", value=28)
|
|
|
14 |
"kayfahaarukku/UrangDiffusion-1.0",
|
15 |
torch_dtype=torch.float16,
|
16 |
custom_pipeline="lpw_stable_diffusion_xl",
|
|
|
17 |
)
|
18 |
pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
19 |
|
|
|
47 |
).images[0]
|
48 |
|
49 |
torch.cuda.empty_cache()
|
|
|
50 |
|
51 |
return image, seed
|
52 |
|
|
|
73 |
"1344x768", "768x1344", "1536x640", "640x1536"
|
74 |
],
|
75 |
label="Resolution",
|
76 |
+
value="832x1216"
|
77 |
)
|
78 |
guidance_scale_input = gr.Slider(minimum=1, maximum=20, step=0.5, label="Guidance Scale", value=7)
|
79 |
num_inference_steps_input = gr.Slider(minimum=1, maximum=100, step=1, label="Number of Inference Steps", value=28)
|