Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,10 +4,10 @@ import torch
|
|
4 |
from clip_slider_pipeline import CLIPSliderXL
|
5 |
from diffusers import StableDiffusionXLPipeline, EulerDiscreteScheduler, AutoencoderKL
|
6 |
|
7 |
-
vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
|
8 |
-
flash_pipe = StableDiffusionXLPipeline.from_pretrained("sd-community/sdxl-flash"
|
9 |
flash_pipe.scheduler = EulerDiscreteScheduler.from_config(flash_pipe.scheduler.config)
|
10 |
-
clip_slider = CLIPSliderXL(flash_pipe, device=torch.device("cuda"), iterations=
|
11 |
|
12 |
@spaces.GPU
|
13 |
def generate(slider_x, slider_y, prompt,
|
@@ -95,6 +95,8 @@ with gr.Blocks(css=css) as demo:
|
|
95 |
x = gr.Slider(minimum=-10, value=0, maximum=10, elem_id="x", interactive=False)
|
96 |
y = gr.Slider(minimum=-10, value=0, maximum=10, elem_id="y", interactive=False)
|
97 |
output_image = gr.Image(elem_id="image_out")
|
|
|
|
|
98 |
|
99 |
submit.click(fn=generate,
|
100 |
inputs=[slider_x, slider_y, prompt, x_concept_1, x_concept_2, y_concept_1, y_concept_2, avg_diff_x_1, avg_diff_x_2, avg_diff_y_1, avg_diff_y_2],
|
|
|
4 |
from clip_slider_pipeline import CLIPSliderXL
|
5 |
from diffusers import StableDiffusionXLPipeline, EulerDiscreteScheduler, AutoencoderKL
|
6 |
|
7 |
+
#vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
|
8 |
+
flash_pipe = StableDiffusionXLPipeline.from_pretrained("sd-community/sdxl-flash").to("cuda", torch.float16)
|
9 |
flash_pipe.scheduler = EulerDiscreteScheduler.from_config(flash_pipe.scheduler.config)
|
10 |
+
clip_slider = CLIPSliderXL(flash_pipe, device=torch.device("cuda"), iterations=100)
|
11 |
|
12 |
@spaces.GPU
|
13 |
def generate(slider_x, slider_y, prompt,
|
|
|
95 |
x = gr.Slider(minimum=-10, value=0, maximum=10, elem_id="x", interactive=False)
|
96 |
y = gr.Slider(minimum=-10, value=0, maximum=10, elem_id="y", interactive=False)
|
97 |
output_image = gr.Image(elem_id="image_out")
|
98 |
+
with gr.Accordion(label="advanced options"):
|
99 |
+
|
100 |
|
101 |
submit.click(fn=generate,
|
102 |
inputs=[slider_x, slider_y, prompt, x_concept_1, x_concept_2, y_concept_1, y_concept_2, avg_diff_x_1, avg_diff_x_2, avg_diff_y_1, avg_diff_y_2],
|