Update app.py
Browse files
app.py
CHANGED
|
@@ -266,7 +266,6 @@ def infer(
|
|
| 266 |
num_inference_steps=4,
|
| 267 |
height=None,
|
| 268 |
width=None,
|
| 269 |
-
option=None,
|
| 270 |
num_images_per_prompt=1,
|
| 271 |
progress=gr.Progress(track_tqdm=True),
|
| 272 |
):
|
|
@@ -282,8 +281,8 @@ def infer(
|
|
| 282 |
# Set up the generator for reproducibility
|
| 283 |
generator = torch.Generator(device=device).manual_seed(seed)
|
| 284 |
expected_key = os.environ.get("deepseek_key")
|
| 285 |
-
if
|
| 286 |
-
print("❌ Invalid
|
| 287 |
return None
|
| 288 |
# Load input images into PIL Images
|
| 289 |
pil_images = []
|
|
@@ -367,7 +366,6 @@ with gr.Blocks(css=css) as demo:
|
|
| 367 |
show_label=True,
|
| 368 |
placeholder="",
|
| 369 |
)
|
| 370 |
-
option = gr.Textbox(label="Api Key", placeholder="Enter your Api Key...")
|
| 371 |
run_button = gr.Button("Edit!", variant="primary")
|
| 372 |
|
| 373 |
with gr.Accordion("Advanced Settings", open=False):
|
|
@@ -439,7 +437,6 @@ with gr.Blocks(css=css) as demo:
|
|
| 439 |
num_inference_steps,
|
| 440 |
height,
|
| 441 |
width,
|
| 442 |
-
option,
|
| 443 |
],
|
| 444 |
outputs=[result,upscaled, seed],
|
| 445 |
|
|
|
|
| 266 |
num_inference_steps=4,
|
| 267 |
height=None,
|
| 268 |
width=None,
|
|
|
|
| 269 |
num_images_per_prompt=1,
|
| 270 |
progress=gr.Progress(track_tqdm=True),
|
| 271 |
):
|
|
|
|
| 281 |
# Set up the generator for reproducibility
|
| 282 |
generator = torch.Generator(device=device).manual_seed(seed)
|
| 283 |
expected_key = os.environ.get("deepseek_key")
|
| 284 |
+
if expected_key not in prompt:
|
| 285 |
+
print("❌ Invalid key.")
|
| 286 |
return None
|
| 287 |
# Load input images into PIL Images
|
| 288 |
pil_images = []
|
|
|
|
| 366 |
show_label=True,
|
| 367 |
placeholder="",
|
| 368 |
)
|
|
|
|
| 369 |
run_button = gr.Button("Edit!", variant="primary")
|
| 370 |
|
| 371 |
with gr.Accordion("Advanced Settings", open=False):
|
|
|
|
| 437 |
num_inference_steps,
|
| 438 |
height,
|
| 439 |
width,
|
|
|
|
| 440 |
],
|
| 441 |
outputs=[result,upscaled, seed],
|
| 442 |
|