John6666 commited on
Commit
1396036
1 Parent(s): 713e881

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +72 -68
app.py CHANGED
@@ -120,77 +120,81 @@ with gr.Blocks(css=css, fill_width=True, elem_id="container") as demo:
120
  value=28,
121
  )
122
 
123
- with gr.Group():
124
- model_name = gr.Dropdown(label="Model", info="You can enter a huggingface model repo_id to want to use.", choices=get_diffusers_model_list(), value=get_diffusers_model_list()[0], allow_custom_value=True, interactive=True)
125
- model_info = gr.Markdown(elem_id="model-info")
126
- model_detail = gr.Checkbox(label="Show detail of model in list", value=False)
 
127
 
128
- sampler = gr.Dropdown(label="Sampler", choices=get_samplers(), value="Euler a")
 
 
129
 
130
- chatbot = gr.Chatbot(likeable=False, render_markdown=False, visible=False) # component for auto-translation
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
 
132
- with gr.Accordion("LoRA", open=True, visible=True):
133
- with gr.Group():
134
- lora1 = gr.Dropdown(label="LoRA 1", choices=get_all_lora_tupled_list(), value="", allow_custom_value=True)
135
- lora1_wt = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA 1: weight")
136
- with gr.Row():
137
- lora1_info = gr.Textbox(label="", info="Example of prompt:", value="", show_copy_button=True, interactive=False, visible=False)
138
- lora1_copy = gr.Button(value="Copy example to prompt", visible=False)
139
- lora1_md = gr.Markdown(value="", visible=False)
140
- with gr.Group():
141
- lora2 = gr.Dropdown(label="LoRA 2", choices=get_all_lora_tupled_list(), value="", allow_custom_value=True)
142
- lora2_wt = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA 2: weight")
143
- with gr.Row():
144
- lora2_info = gr.Textbox(label="", info="Example of prompt:", value="", show_copy_button=True, interactive=False, visible=False)
145
- lora2_copy = gr.Button(value="Copy example to prompt", visible=False)
146
- lora2_md = gr.Markdown(value="", visible=False)
147
- with gr.Group():
148
- lora3 = gr.Dropdown(label="LoRA 3", choices=get_all_lora_tupled_list(), value="", allow_custom_value=True)
149
- lora3_wt = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA 3: weight")
150
- with gr.Row():
151
- lora3_info = gr.Textbox(label="", info="Example of prompt:", value="", show_copy_button=True, interactive=False, visible=False)
152
- lora3_copy = gr.Button(value="Copy example to prompt", visible=False)
153
- lora3_md = gr.Markdown(value="", visible=False)
154
- with gr.Group():
155
- lora4 = gr.Dropdown(label="LoRA 4", choices=get_all_lora_tupled_list(), value="", allow_custom_value=True)
156
- lora4_wt = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA 4: weight")
157
- with gr.Row():
158
- lora4_info = gr.Textbox(label="", info="Example of prompt:", value="", show_copy_button=True, interactive=False, visible=False)
159
- lora4_copy = gr.Button(value="Copy example to prompt", visible=False)
160
- lora4_md = gr.Markdown(value="", visible=False)
161
- with gr.Group():
162
- lora5 = gr.Dropdown(label="LoRA 5", choices=get_all_lora_tupled_list(), value="", allow_custom_value=True)
163
- lora5_wt = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA 5: weight")
164
- with gr.Row():
165
- lora5_info = gr.Textbox(label="", info="Example of prompt:", value="", show_copy_button=True, interactive=False, visible=False)
166
- lora5_copy = gr.Button(value="Copy example to prompt", visible=False)
167
- lora5_md = gr.Markdown(value="", visible=False)
168
- with gr.Accordion("From URL", open=True, visible=True):
169
- with gr.Row():
170
- lora_search_civitai_query = gr.Textbox(label="Query", placeholder="oomuro sakurako...", lines=1)
171
- lora_search_civitai_basemodel = gr.CheckboxGroup(label="Search LoRA for", choices=["Pony", "SD 1.5", "SDXL 1.0"], value=["Pony", "SDXL 1.0"])
172
- lora_search_civitai_submit = gr.Button("Search on Civitai")
173
- lora_search_civitai_result = gr.Dropdown(label="Search Results", choices=[("", "")], value="", allow_custom_value=True, visible=False)
174
- lora_search_civitai_json = gr.JSON(value={}, visible=False)
175
- lora_search_civitai_desc = gr.Markdown(value="", visible=False)
176
- lora_download_url = gr.Textbox(label="URL", placeholder="http://...my_lora_url.safetensors", lines=1)
177
- lora_download = gr.Button("Get and set LoRA and apply to prompt")
178
-
179
- vae_model = gr.Dropdown(label="VAE Model", choices=get_vaes(), value=get_vaes()[0])
180
- recom_prompt = gr.Checkbox(label="Recommended prompt", value=True)
181
- quality_selector = gr.Radio(label="Quality Tag Presets", interactive=True, choices=list(preset_quality.keys()), value="None")
182
- style_selector = gr.Radio(label="Style Presets", interactive=True, choices=list(preset_styles.keys()), value="None")
183
-
184
- with gr.Accordion("Translation Settings", open=False):
185
- chat_model = gr.Dropdown(choices=get_dolphin_models(), value=get_dolphin_models()[0][1], allow_custom_value=True, label="Model")
186
- chat_model_info = gr.Markdown(value=get_dolphin_model_info(get_dolphin_models()[0][1]), label="Model info")
187
- chat_format = gr.Dropdown(choices=get_llm_formats(), value=get_dolphin_model_format(get_dolphin_models()[0][1]), label="Message format")
188
- chat_sysmsg = gr.Textbox(value=get_dolphin_sysprompt(), label="System message")
189
- chat_tokens = gr.Slider(minimum=1, maximum=4096, value=512, step=1, label="Max tokens")
190
- chat_temperature = gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature")
191
- chat_topp = gr.Slider(minimum=0.1, maximum=1.0, value=0.95, step=0.05, label="Top-p")
192
- chat_topk = gr.Slider(minimum=0, maximum=100, value=40, step=1, label="Top-k")
193
- chat_rp = gr.Slider(minimum=0.0, maximum=2.0, value=1.1, step=0.1, label="Repetition penalty")
194
 
195
  examples = gr.Examples(
196
  examples = [
 
120
  value=28,
121
  )
122
 
123
+ with gr.Row():
124
+ with gr.Group():
125
+ model_name = gr.Dropdown(label="Model", info="You can enter a huggingface model repo_id to want to use.", choices=get_diffusers_model_list(), value=get_diffusers_model_list()[0], allow_custom_value=True, interactive=True)
126
+ model_info = gr.Markdown(elem_id="model-info")
127
+ model_detail = gr.Checkbox(label="Show detail of model in list", value=False)
128
 
129
+ with gr.Row():
130
+ sampler = gr.Dropdown(label="Sampler", choices=get_samplers(), value="Euler a")
131
+ vae_model = gr.Dropdown(label="VAE Model", choices=get_vaes(), value=get_vaes()[0])
132
 
133
+ with gr.Row():
134
+ with gr.Accordion("LoRA", open=True, visible=True):
135
+ with gr.Group():
136
+ lora1 = gr.Dropdown(label="LoRA 1", choices=get_all_lora_tupled_list(), value="", allow_custom_value=True)
137
+ lora1_wt = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA 1: weight")
138
+ with gr.Row():
139
+ lora1_info = gr.Textbox(label="", info="Example of prompt:", value="", show_copy_button=True, interactive=False, visible=False)
140
+ lora1_copy = gr.Button(value="Copy example to prompt", visible=False)
141
+ lora1_md = gr.Markdown(value="", visible=False)
142
+ with gr.Group():
143
+ lora2 = gr.Dropdown(label="LoRA 2", choices=get_all_lora_tupled_list(), value="", allow_custom_value=True)
144
+ lora2_wt = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA 2: weight")
145
+ with gr.Row():
146
+ lora2_info = gr.Textbox(label="", info="Example of prompt:", value="", show_copy_button=True, interactive=False, visible=False)
147
+ lora2_copy = gr.Button(value="Copy example to prompt", visible=False)
148
+ lora2_md = gr.Markdown(value="", visible=False)
149
+ with gr.Group():
150
+ lora3 = gr.Dropdown(label="LoRA 3", choices=get_all_lora_tupled_list(), value="", allow_custom_value=True)
151
+ lora3_wt = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA 3: weight")
152
+ with gr.Row():
153
+ lora3_info = gr.Textbox(label="", info="Example of prompt:", value="", show_copy_button=True, interactive=False, visible=False)
154
+ lora3_copy = gr.Button(value="Copy example to prompt", visible=False)
155
+ lora3_md = gr.Markdown(value="", visible=False)
156
+ with gr.Group():
157
+ lora4 = gr.Dropdown(label="LoRA 4", choices=get_all_lora_tupled_list(), value="", allow_custom_value=True)
158
+ lora4_wt = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA 4: weight")
159
+ with gr.Row():
160
+ lora4_info = gr.Textbox(label="", info="Example of prompt:", value="", show_copy_button=True, interactive=False, visible=False)
161
+ lora4_copy = gr.Button(value="Copy example to prompt", visible=False)
162
+ lora4_md = gr.Markdown(value="", visible=False)
163
+ with gr.Group():
164
+ lora5 = gr.Dropdown(label="LoRA 5", choices=get_all_lora_tupled_list(), value="", allow_custom_value=True)
165
+ lora5_wt = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA 5: weight")
166
+ with gr.Row():
167
+ lora5_info = gr.Textbox(label="", info="Example of prompt:", value="", show_copy_button=True, interactive=False, visible=False)
168
+ lora5_copy = gr.Button(value="Copy example to prompt", visible=False)
169
+ lora5_md = gr.Markdown(value="", visible=False)
170
+ with gr.Accordion("From URL", open=True, visible=True):
171
+ with gr.Row():
172
+ lora_search_civitai_query = gr.Textbox(label="Query", placeholder="oomuro sakurako...", lines=1)
173
+ lora_search_civitai_basemodel = gr.CheckboxGroup(label="Search LoRA for", choices=["Pony", "SD 1.5", "SDXL 1.0"], value=["Pony", "SDXL 1.0"])
174
+ lora_search_civitai_submit = gr.Button("Search on Civitai")
175
+ lora_search_civitai_result = gr.Dropdown(label="Search Results", choices=[("", "")], value="", allow_custom_value=True, visible=False)
176
+ lora_search_civitai_json = gr.JSON(value={}, visible=False)
177
+ lora_search_civitai_desc = gr.Markdown(value="", visible=False)
178
+ lora_download_url = gr.Textbox(label="URL", placeholder="http://...my_lora_url.safetensors", lines=1)
179
+ lora_download = gr.Button("Get and set LoRA and apply to prompt")
180
 
181
+ with gr.Row():
182
+ recom_prompt = gr.Checkbox(label="Recommended prompt", value=True)
183
+ quality_selector = gr.Radio(label="Quality Tag Presets", interactive=True, choices=list(preset_quality.keys()), value="None")
184
+ style_selector = gr.Radio(label="Style Presets", interactive=True, choices=list(preset_styles.keys()), value="None")
185
+
186
+ with gr.Row():
187
+ with gr.Accordion("Translation Settings", open=False):
188
+ chatbot = gr.Chatbot(likeable=False, render_markdown=False, visible=False) # component for auto-translation
189
+ chat_model = gr.Dropdown(choices=get_dolphin_models(), value=get_dolphin_models()[0][1], allow_custom_value=True, label="Model")
190
+ chat_model_info = gr.Markdown(value=get_dolphin_model_info(get_dolphin_models()[0][1]), label="Model info")
191
+ chat_format = gr.Dropdown(choices=get_llm_formats(), value=get_dolphin_model_format(get_dolphin_models()[0][1]), label="Message format")
192
+ chat_sysmsg = gr.Textbox(value=get_dolphin_sysprompt(), label="System message")
193
+ chat_tokens = gr.Slider(minimum=1, maximum=4096, value=512, step=1, label="Max tokens")
194
+ chat_temperature = gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature")
195
+ chat_topp = gr.Slider(minimum=0.1, maximum=1.0, value=0.95, step=0.05, label="Top-p")
196
+ chat_topk = gr.Slider(minimum=0, maximum=100, value=40, step=1, label="Top-k")
197
+ chat_rp = gr.Slider(minimum=0.0, maximum=2.0, value=1.1, step=0.1, label="Repetition penalty")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
198
 
199
  examples = gr.Examples(
200
  examples = [