John6666 commited on
Commit
2d08726
1 Parent(s): a1097b8

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -14
app.py CHANGED
@@ -38,8 +38,8 @@ MAX_IMAGE_SIZE = 1216
38
 
39
  css = """
40
  #container { margin: 0 auto; !important; }
41
- #col-container { margin: 0 auto; align: center; !important; }
42
- #result { display: block; max-width: 520px; max-height: 520px; width: 520px; height: 520px; align: center; !important; }
43
  #model-info { text-align: center; !important; }
44
  """
45
 
@@ -64,15 +64,20 @@ with gr.Blocks(css=css, fill_width=True, elem_id="container") as demo:
64
  with gr.Row():
65
  seed = gr.Slider(label="Seed", minimum=0, maximum=MAX_SEED, step=1, value=0)
66
  randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
 
 
67
  width = gr.Slider(label="Width", minimum=256, maximum=MAX_IMAGE_SIZE, step=32, value=1024) # 832
68
  height = gr.Slider(label="Height", minimum=256, maximum=MAX_IMAGE_SIZE, step=32, value=1024) # 1216
69
  guidance_scale = gr.Slider(label="Guidance scale", minimum=0.0, maximum=30.0, step=0.1, value=7)
70
  num_inference_steps = gr.Slider(label="Number of inference steps", minimum=1, maximum=100, step=1, value=28)
71
 
72
  with gr.Row():
73
- 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)
74
- model_info = gr.Markdown(elem_id="model-info")
75
- model_detail = gr.Checkbox(label="Show detail of model in list", value=False)
 
 
 
76
 
77
  with gr.Row():
78
  sampler = gr.Dropdown(label="Sampler", choices=get_samplers(), value="Euler a")
@@ -81,35 +86,35 @@ with gr.Blocks(css=css, fill_width=True, elem_id="container") as demo:
81
  with gr.Accordion("LoRA", open=True, visible=True):
82
  with gr.Row():
83
  with gr.Group():
84
- lora1 = gr.Dropdown(label="LoRA 1", choices=get_all_lora_tupled_list(), value="", allow_custom_value=True)
85
  lora1_wt = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA 1: weight")
86
  with gr.Row():
87
  lora1_info = gr.Textbox(label="", info="Example of prompt:", value="", show_copy_button=True, interactive=False, visible=False)
88
  lora1_copy = gr.Button(value="Copy example to prompt", visible=False)
89
  lora1_md = gr.Markdown(value="", visible=False)
90
  with gr.Group():
91
- lora2 = gr.Dropdown(label="LoRA 2", choices=get_all_lora_tupled_list(), value="", allow_custom_value=True)
92
  lora2_wt = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA 2: weight")
93
  with gr.Row():
94
  lora2_info = gr.Textbox(label="", info="Example of prompt:", value="", show_copy_button=True, interactive=False, visible=False)
95
  lora2_copy = gr.Button(value="Copy example to prompt", visible=False)
96
  lora2_md = gr.Markdown(value="", visible=False)
97
  with gr.Group():
98
- lora3 = gr.Dropdown(label="LoRA 3", choices=get_all_lora_tupled_list(), value="", allow_custom_value=True)
99
  lora3_wt = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA 3: weight")
100
  with gr.Row():
101
  lora3_info = gr.Textbox(label="", info="Example of prompt:", value="", show_copy_button=True, interactive=False, visible=False)
102
  lora3_copy = gr.Button(value="Copy example to prompt", visible=False)
103
  lora3_md = gr.Markdown(value="", visible=False)
104
  with gr.Group():
105
- lora4 = gr.Dropdown(label="LoRA 4", choices=get_all_lora_tupled_list(), value="", allow_custom_value=True)
106
  lora4_wt = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA 4: weight")
107
  with gr.Row():
108
  lora4_info = gr.Textbox(label="", info="Example of prompt:", value="", show_copy_button=True, interactive=False, visible=False)
109
  lora4_copy = gr.Button(value="Copy example to prompt", visible=False)
110
  lora4_md = gr.Markdown(value="", visible=False)
111
  with gr.Group():
112
- lora5 = gr.Dropdown(label="LoRA 5", choices=get_all_lora_tupled_list(), value="", allow_custom_value=True)
113
  lora5_wt = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA 5: weight")
114
  with gr.Row():
115
  lora5_info = gr.Textbox(label="", info="Example of prompt:", value="", show_copy_button=True, interactive=False, visible=False)
@@ -132,11 +137,11 @@ with gr.Blocks(css=css, fill_width=True, elem_id="container") as demo:
132
  style_selector = gr.Radio(label="Style Presets", interactive=True, choices=list(preset_styles.keys()), value="None")
133
 
134
  with gr.Accordion("Translation Settings", open=False):
 
 
 
 
135
  with gr.Row():
136
- chatbot = gr.Chatbot(likeable=False, render_markdown=False, visible=False) # component for auto-translation
137
- chat_model = gr.Dropdown(choices=get_dolphin_models(), value=get_dolphin_models()[0][1], allow_custom_value=True, label="Model")
138
- chat_model_info = gr.Markdown(value=get_dolphin_model_info(get_dolphin_models()[0][1]), label="Model info")
139
- chat_format = gr.Dropdown(choices=get_llm_formats(), value=get_dolphin_model_format(get_dolphin_models()[0][1]), label="Message format")
140
  chat_sysmsg = gr.Textbox(value=get_dolphin_sysprompt(), label="System message")
141
  chat_tokens = gr.Slider(minimum=1, maximum=4096, value=512, step=1, label="Max tokens")
142
  chat_temperature = gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature")
 
38
 
39
  css = """
40
  #container { margin: 0 auto; !important; }
41
+ #col-container { margin: 0 auto; !important; }
42
+ #result { display: inline-block; max-width: 520px; max-height: 520px; width: 520px; height: 520px; align: center; margin: 0px auto; !important; }
43
  #model-info { text-align: center; !important; }
44
  """
45
 
 
64
  with gr.Row():
65
  seed = gr.Slider(label="Seed", minimum=0, maximum=MAX_SEED, step=1, value=0)
66
  randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
67
+
68
+ with gr.Row():
69
  width = gr.Slider(label="Width", minimum=256, maximum=MAX_IMAGE_SIZE, step=32, value=1024) # 832
70
  height = gr.Slider(label="Height", minimum=256, maximum=MAX_IMAGE_SIZE, step=32, value=1024) # 1216
71
  guidance_scale = gr.Slider(label="Guidance scale", minimum=0.0, maximum=30.0, step=0.1, value=7)
72
  num_inference_steps = gr.Slider(label="Number of inference steps", minimum=1, maximum=100, step=1, value=28)
73
 
74
  with gr.Row():
75
+ with gr.Column():
76
+ model_name = gr.Dropdown(label="Model", info="You can enter a huggingface model repo_id to want to use.",
77
+ choices=get_diffusers_model_list(), value=get_diffusers_model_list()[0],
78
+ allow_custom_value=True, interactive=True, min_width=320)
79
+ model_info = gr.Markdown(elem_id="model-info")
80
+ model_detail = gr.Checkbox(label="Show detail of model in list", value=False)
81
 
82
  with gr.Row():
83
  sampler = gr.Dropdown(label="Sampler", choices=get_samplers(), value="Euler a")
 
86
  with gr.Accordion("LoRA", open=True, visible=True):
87
  with gr.Row():
88
  with gr.Group():
89
+ lora1 = gr.Dropdown(label="LoRA 1", choices=get_all_lora_tupled_list(), value="", allow_custom_value=True, min_width=320)
90
  lora1_wt = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA 1: weight")
91
  with gr.Row():
92
  lora1_info = gr.Textbox(label="", info="Example of prompt:", value="", show_copy_button=True, interactive=False, visible=False)
93
  lora1_copy = gr.Button(value="Copy example to prompt", visible=False)
94
  lora1_md = gr.Markdown(value="", visible=False)
95
  with gr.Group():
96
+ lora2 = gr.Dropdown(label="LoRA 2", choices=get_all_lora_tupled_list(), value="", allow_custom_value=True, min_width=320)
97
  lora2_wt = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA 2: weight")
98
  with gr.Row():
99
  lora2_info = gr.Textbox(label="", info="Example of prompt:", value="", show_copy_button=True, interactive=False, visible=False)
100
  lora2_copy = gr.Button(value="Copy example to prompt", visible=False)
101
  lora2_md = gr.Markdown(value="", visible=False)
102
  with gr.Group():
103
+ lora3 = gr.Dropdown(label="LoRA 3", choices=get_all_lora_tupled_list(), value="", allow_custom_value=True, min_width=320)
104
  lora3_wt = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA 3: weight")
105
  with gr.Row():
106
  lora3_info = gr.Textbox(label="", info="Example of prompt:", value="", show_copy_button=True, interactive=False, visible=False)
107
  lora3_copy = gr.Button(value="Copy example to prompt", visible=False)
108
  lora3_md = gr.Markdown(value="", visible=False)
109
  with gr.Group():
110
+ lora4 = gr.Dropdown(label="LoRA 4", choices=get_all_lora_tupled_list(), value="", allow_custom_value=True, min_width=320)
111
  lora4_wt = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA 4: weight")
112
  with gr.Row():
113
  lora4_info = gr.Textbox(label="", info="Example of prompt:", value="", show_copy_button=True, interactive=False, visible=False)
114
  lora4_copy = gr.Button(value="Copy example to prompt", visible=False)
115
  lora4_md = gr.Markdown(value="", visible=False)
116
  with gr.Group():
117
+ lora5 = gr.Dropdown(label="LoRA 5", choices=get_all_lora_tupled_list(), value="", allow_custom_value=True, min_width=320)
118
  lora5_wt = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA 5: weight")
119
  with gr.Row():
120
  lora5_info = gr.Textbox(label="", info="Example of prompt:", value="", show_copy_button=True, interactive=False, visible=False)
 
137
  style_selector = gr.Radio(label="Style Presets", interactive=True, choices=list(preset_styles.keys()), value="None")
138
 
139
  with gr.Accordion("Translation Settings", open=False):
140
+ chatbot = gr.Chatbot(likeable=False, render_markdown=False, visible=False) # component for auto-translation
141
+ chat_model = gr.Dropdown(choices=get_dolphin_models(), value=get_dolphin_models()[0][1], allow_custom_value=True, label="Model")
142
+ chat_model_info = gr.Markdown(value=get_dolphin_model_info(get_dolphin_models()[0][1]), label="Model info")
143
+ chat_format = gr.Dropdown(choices=get_llm_formats(), value=get_dolphin_model_format(get_dolphin_models()[0][1]), label="Message format")
144
  with gr.Row():
 
 
 
 
145
  chat_sysmsg = gr.Textbox(value=get_dolphin_sysprompt(), label="System message")
146
  chat_tokens = gr.Slider(minimum=1, maximum=4096, value=512, step=1, label="Max tokens")
147
  chat_temperature = gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature")