tchung1970 Claude commited on
Commit
0198045
·
1 Parent(s): 33ee0b0

Make example buttons fit text width and left-align

Browse files

- Add scale=0 to prevent buttons from expanding
- Add min_width=0 to allow buttons to shrink to text size
- Buttons now fit their content and align left

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -97,11 +97,11 @@ with gr.Blocks(title="🎨 FLUX.1-dev-Picasso") as demo:
97
  return "A cityscape with buildings"
98
 
99
  with gr.Column():
100
- example_btn_1 = gr.Button("A portrait of a woman", size="sm")
101
- example_btn_2 = gr.Button("A still life with fruits and bottles", size="sm")
102
- example_btn_3 = gr.Button("A musician playing guitar", size="sm")
103
- example_btn_4 = gr.Button("Two people having a conversation", size="sm")
104
- example_btn_5 = gr.Button("A cityscape with buildings", size="sm")
105
 
106
  # Connect example buttons to prompt input
107
  example_btn_1.click(fn=set_example_1, outputs=prompt_input)
 
97
  return "A cityscape with buildings"
98
 
99
  with gr.Column():
100
+ example_btn_1 = gr.Button("A portrait of a woman", size="sm", scale=0, min_width=0)
101
+ example_btn_2 = gr.Button("A still life with fruits and bottles", size="sm", scale=0, min_width=0)
102
+ example_btn_3 = gr.Button("A musician playing guitar", size="sm", scale=0, min_width=0)
103
+ example_btn_4 = gr.Button("Two people having a conversation", size="sm", scale=0, min_width=0)
104
+ example_btn_5 = gr.Button("A cityscape with buildings", size="sm", scale=0, min_width=0)
105
 
106
  # Connect example buttons to prompt input
107
  example_btn_1.click(fn=set_example_1, outputs=prompt_input)