Spaces:
Runtime error
Runtime error
more
Browse files
app.py
CHANGED
@@ -28,6 +28,7 @@ print(f"low memory: {LOW_MEMORY}")
|
|
28 |
|
29 |
|
30 |
model = "stabilityai/stable-diffusion-xl-base-1.0"
|
|
|
31 |
# vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=dtype)
|
32 |
scheduler = DDIMScheduler.from_pretrained(model, subfolder="scheduler")
|
33 |
controlnet = ControlNetModel.from_pretrained(
|
@@ -132,12 +133,11 @@ with gr.Blocks(css=css) as demo:
|
|
132 |
gr.Markdown(
|
133 |
"""
|
134 |
# Enhance This
|
135 |
-
###
|
136 |
|
137 |
-
[
|
138 |
You can upload an initial image and prompt to generate an enhanced version.
|
139 |
-
[Duplicate Space](https://huggingface.co/spaces/radames/Enhance-This-
|
140 |
-
GPU Time Comparison: T4: ~276s - A10G: ~113.6s A100: ~43.5s RTX 4090: ~48.1s
|
141 |
|
142 |
<small>
|
143 |
<b>Notes</b> The author advises against the term "super resolution" because it's more like image-to-image generation than enhancement, but it's still a lot of fun!
|
@@ -179,7 +179,7 @@ GPU Time Comparison: T4: ~276s - A10G: ~113.6s A100: ~43.5s RTX 4090: ~48.1s
|
|
179 |
value=2,
|
180 |
step=1,
|
181 |
label="Magnification Scale",
|
182 |
-
|
183 |
)
|
184 |
controlnet_conditioning_scale = gr.Slider(
|
185 |
minimum=0,
|
@@ -212,7 +212,8 @@ GPU Time Comparison: T4: ~276s - A10G: ~113.6s A100: ~43.5s RTX 4090: ~48.1s
|
|
212 |
|
213 |
btn = gr.Button()
|
214 |
with gr.Column(scale=2):
|
215 |
-
|
|
|
216 |
inputs = [
|
217 |
image_input,
|
218 |
prompt,
|
@@ -226,7 +227,9 @@ GPU Time Comparison: T4: ~276s - A10G: ~113.6s A100: ~43.5s RTX 4090: ~48.1s
|
|
226 |
controlnet_end,
|
227 |
]
|
228 |
outputs = [image_slider]
|
229 |
-
btn.click(
|
|
|
|
|
230 |
gr.Examples(
|
231 |
fn=predict,
|
232 |
examples=[
|
@@ -297,7 +300,7 @@ GPU Time Comparison: T4: ~276s - A10G: ~113.6s A100: ~43.5s RTX 4090: ~48.1s
|
|
297 |
5532144938416372000,
|
298 |
0.101,
|
299 |
25.206,
|
300 |
-
4
|
301 |
0.8,
|
302 |
0.0,
|
303 |
1.0,
|
|
|
28 |
|
29 |
|
30 |
model = "stabilityai/stable-diffusion-xl-base-1.0"
|
31 |
+
# model = "stabilityai/sdxl-turbo"
|
32 |
# vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=dtype)
|
33 |
scheduler = DDIMScheduler.from_pretrained(model, subfolder="scheduler")
|
34 |
controlnet = ControlNetModel.from_pretrained(
|
|
|
133 |
gr.Markdown(
|
134 |
"""
|
135 |
# Enhance This
|
136 |
+
### HiDiffusion SDXL
|
137 |
|
138 |
+
[HiDiffusion](https://github.com/megvii-research/HiDiffusion) enables higher-resolution image generation.
|
139 |
You can upload an initial image and prompt to generate an enhanced version.
|
140 |
+
[Duplicate Space](https://huggingface.co/spaces/radames/Enhance-This-HiDiffusion-SDXL?duplicate=true) to avoid the queue.
|
|
|
141 |
|
142 |
<small>
|
143 |
<b>Notes</b> The author advises against the term "super resolution" because it's more like image-to-image generation than enhancement, but it's still a lot of fun!
|
|
|
179 |
value=2,
|
180 |
step=1,
|
181 |
label="Magnification Scale",
|
182 |
+
interactive=False,
|
183 |
)
|
184 |
controlnet_conditioning_scale = gr.Slider(
|
185 |
minimum=0,
|
|
|
212 |
|
213 |
btn = gr.Button()
|
214 |
with gr.Column(scale=2):
|
215 |
+
with gr.Group():
|
216 |
+
image_slider = ImageSlider(position=0.5)
|
217 |
inputs = [
|
218 |
image_input,
|
219 |
prompt,
|
|
|
227 |
controlnet_end,
|
228 |
]
|
229 |
outputs = [image_slider]
|
230 |
+
btn.click(lambda x: None, inputs=None, outputs=image_slider).then(
|
231 |
+
predict, inputs=inputs, outputs=outputs, concurrency_limit=1
|
232 |
+
)
|
233 |
gr.Examples(
|
234 |
fn=predict,
|
235 |
examples=[
|
|
|
300 |
5532144938416372000,
|
301 |
0.101,
|
302 |
25.206,
|
303 |
+
4,
|
304 |
0.8,
|
305 |
0.0,
|
306 |
1.0,
|