tchung1970 Claude Opus 4.5 commited on
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]>

Files changed (2) hide show
  1. CLAUDE.md +2 -2
  2. app.py +9 -9
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`: 2048
45
  - `dtype`: torch.bfloat16
46
- - Default aspect ratio: 1:1 (2048x2048)
 
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 (2048x2048)", 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,15 +611,15 @@ with gr.Blocks(
611
  # Aspect Ratio Dropdown
612
  aspect_ratio = gr.Dropdown(
613
  choices=[
614
- "1:1 (2048x2048)",
615
- "2:3 (1360x2048)",
616
- "3:2 (2048x1360)",
617
- "3:4 (1536x2048)",
618
- "4:3 (2048x1536)",
619
- "9:16 (1152x2048)",
620
- "16:9 (2048x1152)",
621
  ],
622
- value="1:1 (2048x2048)",
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,