Upload app.py
Browse files
app.py
CHANGED
@@ -62,6 +62,7 @@ pipe = pipe.to(device)
|
|
62 |
apply_hidiffusion(pipe)
|
63 |
|
64 |
if not IS_SPACES_ZERO:
|
|
|
65 |
# pipe.enable_xformers_memory_efficient_attention()
|
66 |
pipe.enable_model_cpu_offload()
|
67 |
pipe.enable_vae_tiling()
|
@@ -105,8 +106,8 @@ def predict(
|
|
105 |
intensity_threshold=3,
|
106 |
progress=gr.Progress(track_tqdm=True),
|
107 |
):
|
108 |
-
#if IS_SPACES_ZERO:
|
109 |
-
#
|
110 |
if input_image is None:
|
111 |
raise gr.Error("Please upload an image.")
|
112 |
padded_image = pad_image(input_image).resize((1024, 1024)).convert("RGB")
|
@@ -141,7 +142,7 @@ def predict(
|
|
141 |
output_image = images.images[0]
|
142 |
print(f"Time taken: {time.time() - last_time}")
|
143 |
return output_image, padded_image, anyline_image
|
144 |
-
#return (padded_image, output_image), padded_image, anyline_image # for ImageSlider
|
145 |
|
146 |
|
147 |
css = """
|
@@ -251,7 +252,7 @@ SDXL Controlnet [TheMistoAI/MistoLine](https://huggingface.co/TheMistoAI/MistoLi
|
|
251 |
btn = gr.Button()
|
252 |
with gr.Column(scale=2):
|
253 |
with gr.Group():
|
254 |
-
#image_slider = ImageSlider(position=0.5, type="pil") # broken...
|
255 |
image_slider = gr.Image(type="pil", label="Output Image")
|
256 |
with gr.Row():
|
257 |
padded_image = gr.Image(type="pil", label="Padded Image")
|
|
|
62 |
apply_hidiffusion(pipe)
|
63 |
|
64 |
if not IS_SPACES_ZERO:
|
65 |
+
# apply_hidiffusion(pipe)
|
66 |
# pipe.enable_xformers_memory_efficient_attention()
|
67 |
pipe.enable_model_cpu_offload()
|
68 |
pipe.enable_vae_tiling()
|
|
|
106 |
intensity_threshold=3,
|
107 |
progress=gr.Progress(track_tqdm=True),
|
108 |
):
|
109 |
+
# if IS_SPACES_ZERO:
|
110 |
+
# apply_hidiffusion(pipe)
|
111 |
if input_image is None:
|
112 |
raise gr.Error("Please upload an image.")
|
113 |
padded_image = pad_image(input_image).resize((1024, 1024)).convert("RGB")
|
|
|
142 |
output_image = images.images[0]
|
143 |
print(f"Time taken: {time.time() - last_time}")
|
144 |
return output_image, padded_image, anyline_image
|
145 |
+
# return (padded_image, output_image), padded_image, anyline_image # for ImageSlider
|
146 |
|
147 |
|
148 |
css = """
|
|
|
252 |
btn = gr.Button()
|
253 |
with gr.Column(scale=2):
|
254 |
with gr.Group():
|
255 |
+
# image_slider = ImageSlider(position=0.5, type="pil") # broken...
|
256 |
image_slider = gr.Image(type="pil", label="Output Image")
|
257 |
with gr.Row():
|
258 |
padded_image = gr.Image(type="pil", label="Padded Image")
|