Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
0a3d63d
1
Parent(s):
c38f72a
Roll back to 1K resolution for aspect ratios
Browse files🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>
CLAUDE.md
CHANGED
|
@@ -41,6 +41,6 @@ The app runs on Hugging Face Spaces with ZeroGPU infrastructure. Requires `HF_TO
|
|
| 41 |
|
| 42 |
### Configuration Constants
|
| 43 |
|
| 44 |
-
- `MAX_IMAGE_SIZE`:
|
| 45 |
- `dtype`: torch.bfloat16
|
| 46 |
-
- Default aspect ratio: 1:1 (
|
|
|
|
| 41 |
|
| 42 |
### Configuration Constants
|
| 43 |
|
| 44 |
+
- `MAX_IMAGE_SIZE`: 1024
|
| 45 |
- `dtype`: torch.bfloat16
|
| 46 |
+
- Default aspect ratio: 1:1 (1024x1024)
|
app.py
CHANGED
|
@@ -196,7 +196,7 @@ def parse_aspect_ratio(aspect_ratio_str):
|
|
| 196 |
return int(match.group(1)), int(match.group(2))
|
| 197 |
return 1024, 1024 # Default
|
| 198 |
|
| 199 |
-
def infer(prompt, aspect_ratio="1:1 (
|
| 200 |
"""Generate an image using FLUX.2 model."""
|
| 201 |
if not prompt.strip():
|
| 202 |
raise gr.Error("Please enter a prompt to generate an image.")
|
|
@@ -611,15 +611,15 @@ with gr.Blocks(
|
|
| 611 |
# Aspect Ratio Dropdown
|
| 612 |
aspect_ratio = gr.Dropdown(
|
| 613 |
choices=[
|
| 614 |
-
"1:1 (
|
| 615 |
-
"2:3 (
|
| 616 |
-
"3:2 (
|
| 617 |
-
"3:4 (
|
| 618 |
-
"4:3 (
|
| 619 |
-
"9:16 (
|
| 620 |
-
"16:9 (
|
| 621 |
],
|
| 622 |
-
value="1:1 (
|
| 623 |
label="Aspect Ratio",
|
| 624 |
show_label=True,
|
| 625 |
container=True,
|
|
|
|
| 196 |
return int(match.group(1)), int(match.group(2))
|
| 197 |
return 1024, 1024 # Default
|
| 198 |
|
| 199 |
+
def infer(prompt, aspect_ratio="1:1 (1024x1024)", progress=gr.Progress(track_tqdm=True)):
|
| 200 |
"""Generate an image using FLUX.2 model."""
|
| 201 |
if not prompt.strip():
|
| 202 |
raise gr.Error("Please enter a prompt to generate an image.")
|
|
|
|
| 611 |
# Aspect Ratio Dropdown
|
| 612 |
aspect_ratio = gr.Dropdown(
|
| 613 |
choices=[
|
| 614 |
+
"1:1 (1024x1024)",
|
| 615 |
+
"2:3 (680x1024)",
|
| 616 |
+
"3:2 (1024x680)",
|
| 617 |
+
"3:4 (768x1024)",
|
| 618 |
+
"4:3 (1024x768)",
|
| 619 |
+
"9:16 (576x1024)",
|
| 620 |
+
"16:9 (1024x576)",
|
| 621 |
],
|
| 622 |
+
value="1:1 (1024x1024)",
|
| 623 |
label="Aspect Ratio",
|
| 624 |
show_label=True,
|
| 625 |
container=True,
|