Julian Bilcke commited on
Commit
d8a17a7
·
1 Parent(s): 9cd331b

fix default values

Browse files
Files changed (2) hide show
  1. app.py +6 -4
  2. page_layouts.yaml +19 -19
app.py CHANGED
@@ -1102,7 +1102,7 @@ with gr.Blocks(css=css) as demo:
1102
 
1103
  # Number of images slider
1104
  num_images_slider = gr.Slider(
1105
- label="Images per page",
1106
  minimum=1,
1107
  # we can support 8, but we will need better layouts
1108
  # also starting from 8 I notice some latency for story generation
@@ -1112,11 +1112,13 @@ with gr.Blocks(css=css) as demo:
1112
  scale=1
1113
  )
1114
 
1115
- # Page layout dropdown
 
 
1116
  layout_dropdown = gr.Dropdown(
1117
  label="Page Layout",
1118
- choices=[("Full Page", "full_page")],
1119
- value="full_page",
1120
  interactive=True,
1121
  scale=1
1122
  )
 
1102
 
1103
  # Number of images slider
1104
  num_images_slider = gr.Slider(
1105
+ label="Nb of panels",
1106
  minimum=1,
1107
  # we can support 8, but we will need better layouts
1108
  # also starting from 8 I notice some latency for story generation
 
1112
  scale=1
1113
  )
1114
 
1115
+ # Page layout dropdown - initialize with correct choices for default value (6 images)
1116
+ default_num_images = 6
1117
+ default_layout_choices = get_layout_choices(default_num_images)
1118
  layout_dropdown = gr.Dropdown(
1119
  label="Page Layout",
1120
+ choices=default_layout_choices,
1121
+ value=default_layout_choices[0][1] if default_layout_choices else "default",
1122
  interactive=True,
1123
  scale=1
1124
  )
page_layouts.yaml CHANGED
@@ -1169,25 +1169,25 @@ layouts:
1169
  - {panel_type: "closeup", focus: "emotion", composition: "portrait"}
1170
 
1171
  7_images:
1172
- - id: "hero_hexagon"
1173
- label: "Hero Hexagon"
1174
- description: "Central focus with six surrounding"
1175
- positions:
1176
- - [0.28, 0.02, 0.44, 0.3]
1177
- - [0.02, 0.25, 0.3, 0.25]
1178
- - [0.68, 0.25, 0.3, 0.25]
1179
- - [0.25, 0.35, 0.5, 0.3]
1180
- - [0.02, 0.52, 0.3, 0.25]
1181
- - [0.68, 0.52, 0.3, 0.25]
1182
- - [0.28, 0.68, 0.44, 0.3]
1183
- metadata:
1184
- - {panel_type: "establishing", focus: "environment", composition: "landscape"}
1185
- - {panel_type: "detail", focus: "object", composition: "landscape"}
1186
- - {panel_type: "detail", focus: "object", composition: "landscape"}
1187
- - {panel_type: "action", focus: "character", composition: "landscape"}
1188
- - {panel_type: "dialogue", focus: "character", composition: "landscape"}
1189
- - {panel_type: "dialogue", focus: "character", composition: "landscape"}
1190
- - {panel_type: "reaction", focus: "emotion", composition: "landscape"}
1191
 
1192
  - id: "narrative_flow"
1193
  label: "Narrative Flow"
 
1169
  - {panel_type: "closeup", focus: "emotion", composition: "portrait"}
1170
 
1171
  7_images:
1172
+ #- id: "hero_hexagon"
1173
+ # label: "Hero Hexagon"
1174
+ # description: "Central focus with six surrounding"
1175
+ # positions:
1176
+ # - [0.28, 0.02, 0.44, 0.3]
1177
+ # - [0.02, 0.25, 0.3, 0.25]
1178
+ # - [0.68, 0.25, 0.3, 0.25]
1179
+ # - [0.25, 0.35, 0.5, 0.3]
1180
+ # - [0.02, 0.52, 0.3, 0.25]
1181
+ # - [0.68, 0.52, 0.3, 0.25]
1182
+ # - [0.28, 0.68, 0.44, 0.3]
1183
+ # metadata:
1184
+ # - {panel_type: "establishing", focus: "environment", composition: "landscape"}
1185
+ # - {panel_type: "detail", focus: "object", composition: "landscape"}
1186
+ # - {panel_type: "detail", focus: "object", composition: "landscape"}
1187
+ # - {panel_type: "action", focus: "character", composition: "landscape"}
1188
+ # - {panel_type: "dialogue", focus: "character", composition: "landscape"}
1189
+ # - {panel_type: "dialogue", focus: "character", composition: "landscape"}
1190
+ # - {panel_type: "reaction", focus: "emotion", composition: "landscape"}
1191
 
1192
  - id: "narrative_flow"
1193
  label: "Narrative Flow"