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

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -40,6 +40,7 @@ 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
 
@@ -72,12 +73,13 @@ with gr.Blocks(css=css, fill_width=True, elem_id="container") as demo:
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,35 +88,35 @@ with gr.Blocks(css=css, fill_width=True, elem_id="container") as demo:
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)
 
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
+ .lora { display: inline-block; min-width: 320px; !important; }
44
  #model-info { text-align: center; !important; }
45
  """
46
 
 
73
  num_inference_steps = gr.Slider(label="Number of inference steps", minimum=1, maximum=100, step=1, value=28)
74
 
75
  with gr.Row():
76
+ with gr.Column(scale=4):
77
  model_name = gr.Dropdown(label="Model", info="You can enter a huggingface model repo_id to want to use.",
78
  choices=get_diffusers_model_list(), value=get_diffusers_model_list()[0],
79
  allow_custom_value=True, interactive=True, min_width=320)
80
  model_info = gr.Markdown(elem_id="model-info")
81
+ with gr.Column(scale=1):
82
+ model_detail = gr.Checkbox(label="Show detail of model in list", value=False)
83
 
84
  with gr.Row():
85
  sampler = gr.Dropdown(label="Sampler", choices=get_samplers(), value="Euler a")
 
88
  with gr.Accordion("LoRA", open=True, visible=True):
89
  with gr.Row():
90
  with gr.Group():
91
+ lora1 = gr.Dropdown(label="LoRA 1", choices=get_all_lora_tupled_list(), value="", allow_custom_value=True, elem_classes="lora", min_width=320)
92
  lora1_wt = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA 1: weight")
93
  with gr.Row():
94
  lora1_info = gr.Textbox(label="", info="Example of prompt:", value="", show_copy_button=True, interactive=False, visible=False)
95
  lora1_copy = gr.Button(value="Copy example to prompt", visible=False)
96
  lora1_md = gr.Markdown(value="", visible=False)
97
  with gr.Group():
98
+ lora2 = gr.Dropdown(label="LoRA 2", choices=get_all_lora_tupled_list(), value="", allow_custom_value=True, elem_classes="lora", min_width=320)
99
  lora2_wt = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA 2: weight")
100
  with gr.Row():
101
  lora2_info = gr.Textbox(label="", info="Example of prompt:", value="", show_copy_button=True, interactive=False, visible=False)
102
  lora2_copy = gr.Button(value="Copy example to prompt", visible=False)
103
  lora2_md = gr.Markdown(value="", visible=False)
104
  with gr.Group():
105
+ lora3 = gr.Dropdown(label="LoRA 3", choices=get_all_lora_tupled_list(), value="", allow_custom_value=True, elem_classes="lora", min_width=320)
106
  lora3_wt = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA 3: weight")
107
  with gr.Row():
108
  lora3_info = gr.Textbox(label="", info="Example of prompt:", value="", show_copy_button=True, interactive=False, visible=False)
109
  lora3_copy = gr.Button(value="Copy example to prompt", visible=False)
110
  lora3_md = gr.Markdown(value="", visible=False)
111
  with gr.Group():
112
+ lora4 = gr.Dropdown(label="LoRA 4", choices=get_all_lora_tupled_list(), value="", allow_custom_value=True, elem_classes="lora", min_width=320)
113
  lora4_wt = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA 4: weight")
114
  with gr.Row():
115
  lora4_info = gr.Textbox(label="", info="Example of prompt:", value="", show_copy_button=True, interactive=False, visible=False)
116
  lora4_copy = gr.Button(value="Copy example to prompt", visible=False)
117
  lora4_md = gr.Markdown(value="", visible=False)
118
  with gr.Group():
119
+ lora5 = gr.Dropdown(label="LoRA 5", choices=get_all_lora_tupled_list(), value="", allow_custom_value=True, elem_classes="lora", min_width=320)
120
  lora5_wt = gr.Slider(minimum=-2, maximum=2, step=0.01, value=1.00, label="LoRA 5: weight")
121
  with gr.Row():
122
  lora5_info = gr.Textbox(label="", info="Example of prompt:", value="", show_copy_button=True, interactive=False, visible=False)