Description
The "Figure Size" dropdown in the Gradio web UI (app.py) accepts user input but the selected value is never passed to the image generation pipeline. All generated images use a hardcoded image_size="1k" regardless of the Figure Size selection.
Steps to Reproduce
- Open the Gradio UI (
python app.py)
- In Settings, change "Figure Size" to any value (e.g., "14-17cm")
- Generate candidates
- Observe that the output image resolution is always 1k
Root Cause
In app.py, run_generate() receives figure_size and stores it in a local dict:
params = {"figure_size": figure_size}
But params is never passed to process_parallel_candidates() or any downstream function. The variable is effectively dead code.
Meanwhile, in agents/visualizer_agent.py, image_size is hardcoded to "1k" in both the Gemini and OpenRouter image generation paths (lines 192 and 206):
"image_size": "1k", # hardcoded, ignores UI setting
Suggested Fix
- Pass
figure_size through additional_info in create_sample_inputs()
- In
VisualizerAgent, read figure_size from data["additional_info"] and map it to an appropriate image_size value:
| Figure Size |
Suggested image_size |
| 1-3cm, 4-6cm |
1k |
| 7-9cm, 10-13cm |
2k |
| 14-17cm |
4k |
Environment
- PaperBanana version:
fed1812 (latest main)
- Gradio UI (
app.py)
Description
The "Figure Size" dropdown in the Gradio web UI (
app.py) accepts user input but the selected value is never passed to the image generation pipeline. All generated images use a hardcodedimage_size="1k"regardless of the Figure Size selection.Steps to Reproduce
python app.py)Root Cause
In
app.py,run_generate()receivesfigure_sizeand stores it in a local dict:But
paramsis never passed toprocess_parallel_candidates()or any downstream function. The variable is effectively dead code.Meanwhile, in
agents/visualizer_agent.py,image_sizeis hardcoded to"1k"in both the Gemini and OpenRouter image generation paths (lines 192 and 206):Suggested Fix
figure_sizethroughadditional_infoincreate_sample_inputs()VisualizerAgent, readfigure_sizefromdata["additional_info"]and map it to an appropriateimage_sizevalue:Environment
fed1812(latest main)app.py)