Upload 3 files
Browse files- README.md +1 -2
- app.py +11 -7
- requirements.txt +15 -15
README.md
CHANGED
@@ -4,10 +4,9 @@ emoji: 🔍🕵️
|
|
4 |
colorFrom: pink
|
5 |
colorTo: pink
|
6 |
sdk: gradio
|
7 |
-
sdk_version: 5.
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
-
suggested_hardware: t4-medium
|
11 |
disable_embedding: true
|
12 |
short_description: Creative Upscaler High-Res Image Generation HiDiffusion SDXL
|
13 |
---
|
|
|
4 |
colorFrom: pink
|
5 |
colorTo: pink
|
6 |
sdk: gradio
|
7 |
+
sdk_version: 5.23.1
|
8 |
app_file: app.py
|
9 |
pinned: false
|
|
|
10 |
disable_embedding: true
|
11 |
short_description: Creative Upscaler High-Res Image Generation HiDiffusion SDXL
|
12 |
---
|
app.py
CHANGED
@@ -59,9 +59,9 @@ compel = Compel(
|
|
59 |
requires_pooled=[False, True],
|
60 |
)
|
61 |
pipe = pipe.to(device)
|
|
|
62 |
|
63 |
if not IS_SPACES_ZERO:
|
64 |
-
apply_hidiffusion(pipe)
|
65 |
# pipe.enable_xformers_memory_efficient_attention()
|
66 |
pipe.enable_model_cpu_offload()
|
67 |
pipe.enable_vae_tiling()
|
@@ -105,8 +105,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")
|
@@ -138,8 +138,10 @@ def predict(
|
|
138 |
guidance_scale=guidance_scale,
|
139 |
eta=1.0,
|
140 |
)
|
|
|
141 |
print(f"Time taken: {time.time() - last_time}")
|
142 |
-
return
|
|
|
143 |
|
144 |
|
145 |
css = """
|
@@ -249,7 +251,8 @@ SDXL Controlnet [TheMistoAI/MistoLine](https://huggingface.co/TheMistoAI/MistoLi
|
|
249 |
btn = gr.Button()
|
250 |
with gr.Column(scale=2):
|
251 |
with gr.Group():
|
252 |
-
image_slider = ImageSlider(position=0.5)
|
|
|
253 |
with gr.Row():
|
254 |
padded_image = gr.Image(type="pil", label="Padded Image")
|
255 |
anyline_image = gr.Image(type="pil", label="Anyline Image")
|
@@ -361,9 +364,10 @@ SDXL Controlnet [TheMistoAI/MistoLine](https://huggingface.co/TheMistoAI/MistoLi
|
|
361 |
3,
|
362 |
],
|
363 |
],
|
364 |
-
cache_examples=
|
|
|
365 |
)
|
366 |
|
367 |
|
368 |
demo.queue(api_open=False)
|
369 |
-
demo.launch(show_api=False)
|
|
|
59 |
requires_pooled=[False, True],
|
60 |
)
|
61 |
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 |
intensity_threshold=3,
|
106 |
progress=gr.Progress(track_tqdm=True),
|
107 |
):
|
108 |
+
#if IS_SPACES_ZERO:
|
109 |
+
# apply_hidiffusion(pipe)
|
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")
|
|
|
138 |
guidance_scale=guidance_scale,
|
139 |
eta=1.0,
|
140 |
)
|
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 |
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")
|
258 |
anyline_image = gr.Image(type="pil", label="Anyline Image")
|
|
|
364 |
3,
|
365 |
],
|
366 |
],
|
367 |
+
cache_examples=True,
|
368 |
+
cache_mode='lazy',
|
369 |
)
|
370 |
|
371 |
|
372 |
demo.queue(api_open=False)
|
373 |
+
demo.launch(show_api=False, ssr_mode=False)
|
requirements.txt
CHANGED
@@ -1,22 +1,22 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
xformers
|
6 |
-
accelerate
|
7 |
-
invisible-watermark
|
8 |
huggingface-hub
|
9 |
hf-transfer
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
numpy
|
14 |
-
diffusers==0.27.0
|
15 |
transformers
|
|
|
16 |
accelerate
|
17 |
safetensors
|
|
|
|
|
|
|
18 |
hidiffusion==0.1.8
|
19 |
-
spaces
|
20 |
-
torch==2.2
|
21 |
controlnet-aux @ git+https://github.com/huggingface/controlnet_aux
|
22 |
-
|
|
|
|
|
|
1 |
+
#spaces
|
2 |
+
#xformers
|
3 |
+
#gradio==5.5.0
|
4 |
+
#huggingface-hub==0.25.2
|
|
|
|
|
|
|
5 |
huggingface-hub
|
6 |
hf-transfer
|
7 |
+
hf-xet
|
8 |
+
torch==2.2
|
9 |
+
torchvision
|
10 |
+
numpy<2
|
|
|
11 |
transformers
|
12 |
+
diffusers<=0.32.2
|
13 |
accelerate
|
14 |
safetensors
|
15 |
+
invisible-watermark
|
16 |
+
compel
|
17 |
+
opencv-python
|
18 |
hidiffusion==0.1.8
|
|
|
|
|
19 |
controlnet-aux @ git+https://github.com/huggingface/controlnet_aux
|
20 |
+
mediapipe
|
21 |
+
pydantic<=2.10.6
|
22 |
+
gradio_imageslider>=0.0.20
|