Skip to content

Bug: Figure Size setting in Gradio UI has no effect on generated images #54

@noking-xdj

Description

@noking-xdj

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

  1. Open the Gradio UI (python app.py)
  2. In Settings, change "Figure Size" to any value (e.g., "14-17cm")
  3. Generate candidates
  4. 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

  1. Pass figure_size through additional_info in create_sample_inputs()
  2. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions