Spaces:
Running on Zero
Running on Zero
fix: always upload to R2 when SCONFIG is set (remove web-UI check)
Browse files
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 |
-
#
|
| 1416 |
-
# (
|
| 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()
|