ultimaxxl commited on
Commit
7edace2
·
verified ·
1 Parent(s): 00df420

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -19
app.py CHANGED
@@ -352,16 +352,17 @@ def generate_image(prompt, structure_image, style_image, depth_strength=15, cann
352
  )
353
 
354
  try:
355
- # Get the saved file path
356
- saved_filename = saved_data["ui"]["images"][0]["filename"]
357
- saved_subfolder = saved_data["ui"]["images"][0]["subfolder"]
358
- output_dir = folder_paths.get_output_directory()
359
 
360
- # Construct the full path
361
- if saved_subfolder:
362
- full_path = os.path.join(output_dir, saved_subfolder, saved_filename)
363
- else:
364
- full_path = os.path.join(output_dir, saved_filename)
 
365
 
366
  return full_path
367
  except Exception as e:
@@ -428,16 +429,16 @@ with gr.Blocks(css="footer {visibility: hidden}") as app:
428
  with gr.Column(scale=1):
429
  output_image = gr.Image(label="Generated Image")
430
 
431
- gr.Examples(
432
- examples=[
433
- ["A beautiful landscape with mountains and a lake", "examples/structure1.jpg", "examples/style1.jpg", 20, 0.4, 0.6, 30],
434
- ["A cyberpunk cityscape at night", "examples/structure2.jpg", "examples/style2.jpg", 15, 0.35, 0.7, 28],
435
- ],
436
- inputs=[prompt_input, structure_image, style_image, depth_strength, canny_strength, style_strength, steps],
437
- outputs=output_image,
438
- fn=generate_image,
439
- cache_examples=True
440
- )
441
 
442
  generate_btn.click(
443
  fn=generate_image,
 
352
  )
353
 
354
  try:
355
+ # # Get the saved file path
356
+ # saved_filename = saved_data["ui"]["images"][0]["filename"]
357
+ # saved_subfolder = saved_data["ui"]["images"][0]["subfolder"]
358
+ # output_dir = folder_paths.get_output_directory()
359
 
360
+ # # Construct the full path
361
+ # if saved_subfolder:
362
+ # full_path = os.path.join(output_dir, saved_subfolder, saved_filename)
363
+ # else:
364
+ # full_path = os.path.join(output_dir, saved_filename)
365
+ full_path = f"output/{saved_data['ui']['images'][0]['filename']}"
366
 
367
  return full_path
368
  except Exception as e:
 
429
  with gr.Column(scale=1):
430
  output_image = gr.Image(label="Generated Image")
431
 
432
+ # gr.Examples(
433
+ # examples=[
434
+ # ["A beautiful landscape with mountains and a lake", "examples/structure1.jpg", "examples/style1.jpg", 20, 0.4, 0.6, 30],
435
+ # ["A cyberpunk cityscape at night", "examples/structure2.jpg", "examples/style2.jpg", 15, 0.35, 0.7, 28],
436
+ # ],
437
+ # inputs=[prompt_input, structure_image, style_image, depth_strength, canny_strength, style_strength, steps],
438
+ # outputs=output_image,
439
+ # fn=generate_image,
440
+ # cache_examples=True
441
+ # )
442
 
443
  generate_btn.click(
444
  fn=generate_image,