Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,13 +18,13 @@ css = """
|
|
| 18 |
max-width: 512px;
|
| 19 |
}
|
| 20 |
"""
|
| 21 |
-
|
| 22 |
if torch.cuda.is_available():
|
| 23 |
power_device = "GPU"
|
| 24 |
device = "cuda"
|
| 25 |
-
else:
|
| 26 |
-
|
| 27 |
-
|
| 28 |
|
| 29 |
|
| 30 |
huggingface_token = os.getenv("HUGGINFACE_TOKEN")
|
|
@@ -48,7 +48,7 @@ pipe = FluxControlNetPipeline.from_pretrained(
|
|
| 48 |
pipe.to(device)
|
| 49 |
|
| 50 |
MAX_SEED = 1000000
|
| 51 |
-
MAX_PIXEL_BUDGET =
|
| 52 |
|
| 53 |
|
| 54 |
def process_input(input_image, upscale_factor, **kwargs):
|
|
@@ -150,9 +150,9 @@ with gr.Blocks(css=css) as demo:
|
|
| 150 |
num_inference_steps = gr.Slider(
|
| 151 |
label="Number of Inference Steps",
|
| 152 |
minimum=8,
|
| 153 |
-
maximum=
|
| 154 |
step=1,
|
| 155 |
-
value=
|
| 156 |
)
|
| 157 |
upscale_factor = gr.Slider(
|
| 158 |
label="Upscale Factor",
|
|
@@ -225,8 +225,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 225 |
|
| 226 |
gr.Markdown("**Disclaimer:**")
|
| 227 |
gr.Markdown(
|
| 228 |
-
|
| 229 |
-
)
|
| 230 |
gr.on(
|
| 231 |
[run_button.click],
|
| 232 |
fn=infer,
|
|
@@ -239,8 +238,8 @@ with gr.Blocks(css=css) as demo:
|
|
| 239 |
controlnet_conditioning_scale,
|
| 240 |
],
|
| 241 |
outputs=result,
|
| 242 |
-
show_api=
|
| 243 |
-
|
| 244 |
)
|
| 245 |
|
| 246 |
-
demo.queue().launch(share=False, show_api=
|
|
|
|
| 18 |
max-width: 512px;
|
| 19 |
}
|
| 20 |
"""
|
| 21 |
+
'''
|
| 22 |
if torch.cuda.is_available():
|
| 23 |
power_device = "GPU"
|
| 24 |
device = "cuda"
|
| 25 |
+
else:'''
|
| 26 |
+
power_device = "CPU"
|
| 27 |
+
device = "cpu"
|
| 28 |
|
| 29 |
|
| 30 |
huggingface_token = os.getenv("HUGGINFACE_TOKEN")
|
|
|
|
| 48 |
pipe.to(device)
|
| 49 |
|
| 50 |
MAX_SEED = 1000000
|
| 51 |
+
MAX_PIXEL_BUDGET = 512 * 512
|
| 52 |
|
| 53 |
|
| 54 |
def process_input(input_image, upscale_factor, **kwargs):
|
|
|
|
| 150 |
num_inference_steps = gr.Slider(
|
| 151 |
label="Number of Inference Steps",
|
| 152 |
minimum=8,
|
| 153 |
+
maximum=25,
|
| 154 |
step=1,
|
| 155 |
+
value=10,
|
| 156 |
)
|
| 157 |
upscale_factor = gr.Slider(
|
| 158 |
label="Upscale Factor",
|
|
|
|
| 225 |
|
| 226 |
gr.Markdown("**Disclaimer:**")
|
| 227 |
gr.Markdown(
|
| 228 |
+
|
|
|
|
| 229 |
gr.on(
|
| 230 |
[run_button.click],
|
| 231 |
fn=infer,
|
|
|
|
| 238 |
controlnet_conditioning_scale,
|
| 239 |
],
|
| 240 |
outputs=result,
|
| 241 |
+
show_api=True,
|
| 242 |
+
show_progress="minimal",
|
| 243 |
)
|
| 244 |
|
| 245 |
+
demo.queue().launch(share=False, show_api=True)
|