File size: 3,029 Bytes
29a5ed9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import gradio as gr
import modules.shared as shared
from modules import scripts


def on_ui_settings():

    section = ("state", "State")

    shared.opts.add_option("state", shared.OptionInfo([], "Saved main elements", gr.CheckboxGroup, lambda: {
        "choices": [
            "tabs"
        ]
    }, section=section))

    shared.opts.add_option("state_txt2img", shared.OptionInfo([], "Saved elements from txt2img", gr.CheckboxGroup, lambda: {
        "choices": [
            "prompt",
            "negative_prompt",
            "styles",
            "sampling",
            "scheduler",
            "sampling_steps",
            "width",
            "height",
            "batch_count",
            "batch_size",
            "cfg_scale",
            "seed",
            "hires_fix",
            "hires_upscaler",
            "hires_steps",
            "hires_scale",
            "hires_resize_x",
            "hires_resize_y",
            "hires_denoising_strength",
            "refiner",
            "refiner_checkpoint",
            "refiner_switch",
            'upscaler_scale_by_resize',
            'upscaler_scale_by_max_side_length',
            'upscaler_scale_to_w',
            'upscaler_scale_to_h',
            'upscaler_scale_to_crop',
            'upscaler_1',
            'upscaler_2',
            'upscaler_2_visibility',
            "script"
        ]
    }, section=section))

    shared.opts.add_option("state_img2img", shared.OptionInfo([], "Saved elements from img2img", gr.CheckboxGroup, lambda: {
        "choices": [
            "prompt",
            "negative_prompt",
            "styles",
            "refiner",
            "refiner_checkpoint",
            "refiner_switch",
            'upscaler_scale_by_resize',
            'upscaler_scale_by_max_side_length',
            'upscaler_scale_to_w',
            'upscaler_scale_to_h',
            'upscaler_scale_to_crop',
            'upscaler_1',
            'upscaler_2',
            'upscaler_2_visibility',
            "sampling",
            "scheduler",
            "resize_mode",
            "sampling_steps",
            "width",
            "height",
            "batch_count",
            "batch_size",
            "cfg_scale",
            "denoising_strength",
            "seed",
            "script"
        ]
    }, section=section))

    shared.opts.add_option("state_extensions", shared.OptionInfo([], "Saved elements from extensions", gr.CheckboxGroup, lambda: {
        "choices": [
            "control-net",
            "adetailer",
            "multidiffusion",
            "dynamic prompting"
        ]
    }, section=section))

    shared.opts.add_option("state_ui", shared.OptionInfo([
            "Reset Button",
            "Import Button",
            "Export Button"
    ], "State UI", gr.CheckboxGroup, lambda: {
        "choices": [
            "Reset Button",
            "Import Button",
            "Export Button"
        ],
    }, section=section))


scripts.script_callbacks.on_ui_settings(on_ui_settings)