akhaliq HF Staff commited on
Commit
a69ad7c
·
verified ·
1 Parent(s): 4ec59b3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -6
app.py CHANGED
@@ -77,12 +77,8 @@ def chat_fn(message, chat_history, seed, randomize_seed, guidance_scale, steps,
77
  pipe = pipe.to("cpu")
78
  torch.cuda.empty_cache()
79
 
80
- # Save image to temporary file and return the path
81
- with tempfile.NamedTemporaryFile(delete=False, suffix=".png") as tmp_file:
82
- image.save(tmp_file.name, format="PNG")
83
- temp_path = tmp_file.name
84
-
85
- return temp_path
86
 
87
  # --- UI Definition using gr.ChatInterface ---
88
 
 
77
  pipe = pipe.to("cpu")
78
  torch.cuda.empty_cache()
79
 
80
+ # Return the PIL Image as a Gradio Image component
81
+ return gr.Image(value=image)
 
 
 
 
82
 
83
  # --- UI Definition using gr.ChatInterface ---
84