Exched commited on
Commit
f8002a8
·
1 Parent(s): 7e67c71

fix: always upload to R2 when SCONFIG is set (remove web-UI check)

Browse files
Files changed (1) hide show
  1. app.py +2 -7
app.py CHANGED
@@ -1412,13 +1412,8 @@ def generate_and_upload(
1412
  if watermark_module.is_valid(watermark):
1413
  image = watermark_module.apply_to_image(image, watermark)
1414
 
1415
- # Direct Gradio web-UI generations are not uploaded to R2 only API calls
1416
- # (the generator, which forwards a uid cookie) populate the asset store.
1417
- if not r2_uploader.request_is_api(request):
1418
- status = {"r2_skipped": "web-ui generation (not uploaded)", "moderation": moderation}
1419
- yield image, used, status, _progress("done", 1.0, label="Done")
1420
- return
1421
-
1422
  yield None, used, None, _progress("image", 0.97, label="Uploading")
1423
  uid = r2_uploader.uid_from_request(request)
1424
  buf = io.BytesIO()
 
1412
  if watermark_module.is_valid(watermark):
1413
  image = watermark_module.apply_to_image(image, watermark)
1414
 
1415
+ # Upload to R2 when SCONFIG is configured
1416
+ # (removed web-UI check always upload if R2 creds are set)
 
 
 
 
 
1417
  yield None, used, None, _progress("image", 0.97, label="Uploading")
1418
  uid = r2_uploader.uid_from_request(request)
1419
  buf = io.BytesIO()