File size: 1,029 Bytes
d0ba07f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import gradio as gr
from registry import registry

def create_filter_controls():
    controls = {}
    for filter_name in registry.filters:
        params = registry.params_map.get(filter_name, {})
        with gr.Group(visible=filter_name == "Original") as group:
            for param_name, config in params.items():
                if config['type'] == int:
                    controls[f"{filter_name}_{param_name}"] = gr.Slider(
                        minimum=1,
                        maximum=100,
                        value=config['default'],
                        label=param_name.replace('_', ' ').title()
                    )
                elif config['type'] == float:
                    controls[f"{filter_name}_{param_name}"] = gr.Slider(
                        minimum=0.1,
                        maximum=10.0,
                        step=0.1,
                        value=config['default'],
                        label=param_name.replace('_', ' ').title()
                    )
    return controls