zhiweili commited on
Commit
3b23350
1 Parent(s): 01b766d

add lineart and canny scale

Browse files
Files changed (1) hide show
  1. app_haircolor.py +4 -3
app_haircolor.py CHANGED
@@ -119,7 +119,7 @@ def create_demo() -> gr.Blocks:
119
  with gr.Column():
120
  edit_prompt = gr.Textbox(lines=1, label="Edit Prompt", value=DEFAULT_EDIT_PROMPT)
121
  generate_size = gr.Number(label="Generate Size", value=1024)
122
- adapter_weight = gr.Slider(minimum=0, maximum=2, value=1, step=0.1, label="Adapter Weight")
123
  category = gr.Textbox(label="Category", value=DEFAULT_CATEGORY, visible=False)
124
  with gr.Column():
125
  num_steps = gr.Slider(minimum=1, maximum=100, value=30, step=1, label="Num Steps")
@@ -127,7 +127,8 @@ def create_demo() -> gr.Blocks:
127
  mask_expansion = gr.Number(label="Mask Expansion", value=50, visible=True)
128
  with gr.Column():
129
  mask_dilation = gr.Slider(minimum=0, maximum=10, value=2, step=1, label="Mask Dilation")
130
- seed = gr.Number(label="Seed", value=8)
 
131
  g_btn = gr.Button("Edit Image")
132
 
133
  with gr.Row():
@@ -146,7 +147,7 @@ def create_demo() -> gr.Blocks:
146
  outputs=[origin_area_image, croper],
147
  ).success(
148
  fn=image_to_image,
149
- inputs=[origin_area_image, edit_prompt,seed, num_steps, guidance_scale, generate_size, adapter_weight],
150
  outputs=[generated_image, generated_cost],
151
  ).success(
152
  fn=restore_result,
 
119
  with gr.Column():
120
  edit_prompt = gr.Textbox(lines=1, label="Edit Prompt", value=DEFAULT_EDIT_PROMPT)
121
  generate_size = gr.Number(label="Generate Size", value=1024)
122
+ seed = gr.Number(label="Seed", value=8)
123
  category = gr.Textbox(label="Category", value=DEFAULT_CATEGORY, visible=False)
124
  with gr.Column():
125
  num_steps = gr.Slider(minimum=1, maximum=100, value=30, step=1, label="Num Steps")
 
127
  mask_expansion = gr.Number(label="Mask Expansion", value=50, visible=True)
128
  with gr.Column():
129
  mask_dilation = gr.Slider(minimum=0, maximum=10, value=2, step=1, label="Mask Dilation")
130
+ lineart_scale = gr.Slider(minimum=0, maximum=2, value=1, step=0.1, label="Lineart Scale")
131
+ canny_scale = gr.Slider(minimum=0, maximum=2, value=0.5, step=0.1, label="Canny Scale")
132
  g_btn = gr.Button("Edit Image")
133
 
134
  with gr.Row():
 
147
  outputs=[origin_area_image, croper],
148
  ).success(
149
  fn=image_to_image,
150
+ inputs=[origin_area_image, edit_prompt,seed, num_steps, guidance_scale, generate_size, lineart_scale, canny_scale],
151
  outputs=[generated_image, generated_cost],
152
  ).success(
153
  fn=restore_result,