Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
-
|
2 |
-
|
3 |
|
4 |
# Базовые настройки
|
5 |
prompt = gr.Textbox(label="Prompt")
|
@@ -13,8 +13,7 @@ negative_prompt = gr.Textbox(label="Negative Prompt")
|
|
13 |
sampling_method = gr.Radio(
|
14 |
["random", "greedy", "nucleus", "top_k", "top_p"], label="Sampling Method"
|
15 |
)
|
16 |
-
sampling_steps =
|
17 |
-
# Pass min and max as positional arguments after value
|
18 |
cfg_scale = gr.Number(label="CFG Scale", min=0.1, max=10.0, default=1.0)
|
19 |
seed = gr.Number(label="Seed", min=0, max=2**31, default=0)
|
20 |
|
|
|
1 |
+
def create_number_component(label, value, min_val, max_val):
|
2 |
+
return gr.Number(label=label, value=value, min=min_val, max=max_val)
|
3 |
|
4 |
# Базовые настройки
|
5 |
prompt = gr.Textbox(label="Prompt")
|
|
|
13 |
sampling_method = gr.Radio(
|
14 |
["random", "greedy", "nucleus", "top_k", "top_p"], label="Sampling Method"
|
15 |
)
|
16 |
+
sampling_steps = create_number_component(label="Sampling Steps", value=100, min_val=1, max_val=1000)
|
|
|
17 |
cfg_scale = gr.Number(label="CFG Scale", min=0.1, max=10.0, default=1.0)
|
18 |
seed = gr.Number(label="Seed", min=0, max=2**31, default=0)
|
19 |
|