Madiy commited on
Commit
3e4e551
·
verified ·
1 Parent(s): 767ff7c

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -6
app.py CHANGED
@@ -307,7 +307,8 @@ def outpaint_image(image, direction, extend_percent, custom_prompt, progress=gr.
307
 
308
  if image is None:
309
  raise gr.Error("Please upload an image first.")
310
-
 
311
  inpaint.to("cuda")
312
  blip_model.to("cuda")
313
  # Move to GPU inside @spaces.GPU — ZeroGPU has allocated GPU here
@@ -321,11 +322,8 @@ def outpaint_image(image, direction, extend_percent, custom_prompt, progress=gr.
321
 
322
  progress(0.05, desc="Analyzing image with BLIP...")
323
 
324
- if custom_prompt.strip():
325
- blip_caption = custom_prompt.strip()
326
- else:
327
- blip_caption = get_caption(image)
328
- prompt = build_outpaint_prompt(blip_caption)
329
 
330
  base_negative = (
331
  "blurry, bad quality, watermark, text, "
 
307
 
308
  if image is None:
309
  raise gr.Error("Please upload an image first.")
310
+
311
+ prompt = custom_prompt or ""
312
  inpaint.to("cuda")
313
  blip_model.to("cuda")
314
  # Move to GPU inside @spaces.GPU — ZeroGPU has allocated GPU here
 
322
 
323
  progress(0.05, desc="Analyzing image with BLIP...")
324
 
325
+ blip_caption = custom_prompt.strip() if custom_prompt.strip() else get_caption(image)
326
+ prompt = build_outpaint_prompt(blip_caption, image)
 
 
 
327
 
328
  base_negative = (
329
  "blurry, bad quality, watermark, text, "