Spaces:
Running
Running
Update components.py
Browse files- components.py +5 -5
components.py
CHANGED
@@ -5,8 +5,9 @@ def create_filter_controls():
|
|
5 |
controls = {}
|
6 |
for filter_name in registry.filters:
|
7 |
params = registry.params_map.get(filter_name, {})
|
8 |
-
|
9 |
-
|
|
|
10 |
for param_name, config in params.items():
|
11 |
if config['type'] == int:
|
12 |
slider = gr.Slider(
|
@@ -24,7 +25,6 @@ def create_filter_controls():
|
|
24 |
label=param_name.replace('_', ' ').title()
|
25 |
)
|
26 |
filter_controls_list.append(slider)
|
27 |
-
|
28 |
-
|
29 |
-
group.children = group.children + [control] if group.children else [control]
|
30 |
return controls
|
|
|
5 |
controls = {}
|
6 |
for filter_name in registry.filters:
|
7 |
params = registry.params_map.get(filter_name, {})
|
8 |
+
filter_group = gr.Group(visible=filter_name == "Original") # Create group here
|
9 |
+
filter_controls_list = []
|
10 |
+
with filter_group: # Put controls inside the group
|
11 |
for param_name, config in params.items():
|
12 |
if config['type'] == int:
|
13 |
slider = gr.Slider(
|
|
|
25 |
label=param_name.replace('_', ' ').title()
|
26 |
)
|
27 |
filter_controls_list.append(slider)
|
28 |
+
controls[filter_name] = filter_group # Store the group
|
29 |
+
filter_group.children = filter_controls_list # Add controls to the group
|
|
|
30 |
return controls
|