Robert001 commited on
Commit
5354e73
1 Parent(s): 17f246f

app.py update

Browse files
Files changed (1) hide show
  1. app.py +52 -27
app.py CHANGED
@@ -926,7 +926,29 @@ def process_inpainting(input_image, prompt, a_prompt, n_prompt, num_samples, ima
926
 
927
  demo = gr.Blocks()
928
  with demo:
929
- gr.Markdown("UniControl Stable Diffusion Demo")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
930
  with gr.Tabs():
931
  with gr.TabItem("Canny"):
932
  with gr.Row():
@@ -946,12 +968,12 @@ with demo:
946
  low_threshold = gr.Slider(label="Canny low threshold", minimum=1, maximum=255, value=40, step=1)
947
  high_threshold = gr.Slider(label="Canny high threshold", minimum=1, maximum=255, value=200,
948
  step=1)
949
- ddim_steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=30, step=1)
950
  scale = gr.Slider(label="Guidance Scale", minimum=0.1, maximum=30.0, value=9.0, step=0.1)
951
  seed = gr.Slider(label="Seed", minimum=-1, maximum=2147483647, step=1, randomize=True)
952
  eta = gr.Number(label="eta (DDIM)", value=0.0)
953
  a_prompt = gr.Textbox(label="Added Prompt", value='best quality, extremely detailed, bright')
954
- n_prompt = gr.Textbox(label="Negative Prompt", value='')
955
  with gr.Column():
956
  result_gallery = gr.Gallery(label='Output', show_label=False, elem_id="gallery").style(grid=2,
957
  height='auto')
@@ -976,12 +998,12 @@ with demo:
976
  guess_mode = gr.Checkbox(label='Guess Mode', value=False)
977
  detect_resolution = gr.Slider(label="HED Resolution", minimum=128, maximum=1024, value=512,
978
  step=1)
979
- ddim_steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=30, step=1)
980
  scale = gr.Slider(label="Guidance Scale", minimum=0.1, maximum=30.0, value=9.0, step=0.1)
981
  seed = gr.Slider(label="Seed", minimum=-1, maximum=2147483647, step=1, randomize=True)
982
  eta = gr.Number(label="eta (DDIM)", value=0.0)
983
  a_prompt = gr.Textbox(label="Added Prompt", value='best quality, extremely detailed, bright')
984
- n_prompt = gr.Textbox(label="Negative Prompt", value='')
985
  with gr.Column():
986
  result_gallery = gr.Gallery(label='Output', show_label=False, elem_id="gallery").style(grid=2,
987
  height='auto')
@@ -1002,16 +1024,16 @@ with demo:
1002
  image_resolution = gr.Slider(label="Image Resolution", minimum=256, maximum=768, value=512,
1003
  step=64)
1004
  strength = gr.Slider(label="Control Strength", minimum=0.0, maximum=2.0, value=1.0, step=0.01)
1005
- condition_mode = gr.Checkbox(label='Condition Extraction', value=True)
1006
  guess_mode = gr.Checkbox(label='Guess Mode', value=False)
1007
  detect_resolution = gr.Slider(label="HED Resolution", minimum=128, maximum=1024, value=512,
1008
  step=1)
1009
- ddim_steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=30, step=1)
1010
  scale = gr.Slider(label="Guidance Scale", minimum=0.1, maximum=30.0, value=9.0, step=0.1)
1011
  seed = gr.Slider(label="Seed", minimum=-1, maximum=2147483647, step=1, randomize=True)
1012
  eta = gr.Number(label="eta (DDIM)", value=0.0)
1013
  a_prompt = gr.Textbox(label="Added Prompt", value='best quality, extremely detailed')
1014
- n_prompt = gr.Textbox(label="Negative Prompt", value='')
1015
  with gr.Column():
1016
  result_gallery = gr.Gallery(label='Output', show_label=False, elem_id="gallery").style(grid=2,
1017
  height='auto')
@@ -1036,12 +1058,12 @@ with demo:
1036
  guess_mode = gr.Checkbox(label='Guess Mode', value=False)
1037
  detect_resolution = gr.Slider(label="Depth Resolution", minimum=128, maximum=1024, value=384,
1038
  step=1)
1039
- ddim_steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=30, step=1)
1040
  scale = gr.Slider(label="Guidance Scale", minimum=0.1, maximum=30.0, value=9.0, step=0.1)
1041
  seed = gr.Slider(label="Seed", minimum=-1, maximum=2147483647, step=1, randomize=True)
1042
  eta = gr.Number(label="eta (DDIM)", value=0.0)
1043
  a_prompt = gr.Textbox(label="Added Prompt", value='best quality, extremely detailed, bright')
1044
- n_prompt = gr.Textbox(label="Negative Prompt", value='')
1045
  with gr.Column():
1046
  result_gallery = gr.Gallery(label='Output', show_label=False, elem_id="gallery").style(grid=2,
1047
  height='auto')
@@ -1066,12 +1088,12 @@ with demo:
1066
  guess_mode = gr.Checkbox(label='Guess Mode', value=False)
1067
  detect_resolution = gr.Slider(label="Depth Resolution", minimum=128, maximum=1024, value=384,
1068
  step=1)
1069
- ddim_steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=30, step=1)
1070
  scale = gr.Slider(label="Guidance Scale", minimum=0.1, maximum=30.0, value=9.0, step=0.1)
1071
  seed = gr.Slider(label="Seed", minimum=-1, maximum=2147483647, step=1, randomize=True)
1072
  eta = gr.Number(label="eta (DDIM)", value=0.0)
1073
  a_prompt = gr.Textbox(label="Added Prompt", value='best quality, extremely detailed, bright')
1074
- n_prompt = gr.Textbox(label="Negative Prompt", value='')
1075
  with gr.Column():
1076
  result_gallery = gr.Gallery(label='Output', show_label=False, elem_id="gallery").style(grid=2,
1077
  height='auto')
@@ -1096,12 +1118,12 @@ with demo:
1096
  guess_mode = gr.Checkbox(label='Guess Mode', value=False)
1097
  detect_resolution = gr.Slider(label="OpenPose Resolution", minimum=128, maximum=1024, value=512,
1098
  step=1)
1099
- ddim_steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=30, step=1)
1100
  scale = gr.Slider(label="Guidance Scale", minimum=0.1, maximum=30.0, value=9.0, step=0.1)
1101
  seed = gr.Slider(label="Seed", minimum=-1, maximum=2147483647, step=1, randomize=True)
1102
  eta = gr.Number(label="eta (DDIM)", value=0.0)
1103
  a_prompt = gr.Textbox(label="Added Prompt", value='best quality, extremely detailed, bright')
1104
- n_prompt = gr.Textbox(label="Negative Prompt", value='')
1105
  with gr.Column():
1106
  result_gallery = gr.Gallery(label='Output', show_label=False, elem_id="gallery").style(grid=2,
1107
  height='auto')
@@ -1126,12 +1148,12 @@ with demo:
1126
  guess_mode = gr.Checkbox(label='Guess Mode', value=False)
1127
  detect_resolution = gr.Slider(label="Segmentation Resolution", minimum=128, maximum=1024,
1128
  value=512, step=1)
1129
- ddim_steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=30, step=1)
1130
  scale = gr.Slider(label="Guidance Scale", minimum=0.1, maximum=30.0, value=9.0, step=0.1)
1131
  seed = gr.Slider(label="Seed", minimum=-1, maximum=2147483647, step=1, randomize=True)
1132
  eta = gr.Number(label="eta (DDIM)", value=0.0)
1133
  a_prompt = gr.Textbox(label="Added Prompt", value='best quality, extremely detailed, bright')
1134
- n_prompt = gr.Textbox(label="Negative Prompt", value='')
1135
  with gr.Column():
1136
  result_gallery = gr.Gallery(label='Output', show_label=False, elem_id="gallery").style(grid=2,
1137
  height='auto')
@@ -1157,12 +1179,12 @@ with demo:
1157
  confidence = gr.Slider(label="Confidence of Detection", minimum=0.1, maximum=1.0, value=0.4,
1158
  step=0.1)
1159
  nms_thresh = gr.Slider(label="Nms Threshold", minimum=0.1, maximum=1.0, value=0.5, step=0.1)
1160
- ddim_steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=30, step=1)
1161
  scale = gr.Slider(label="Guidance Scale", minimum=0.1, maximum=30.0, value=9.0, step=0.1)
1162
  seed = gr.Slider(label="Seed", minimum=-1, maximum=2147483647, step=1, randomize=True)
1163
  eta = gr.Number(label="eta (DDIM)", value=0.0)
1164
  a_prompt = gr.Textbox(label="Added Prompt", value='best quality, extremely detailed, bright')
1165
- n_prompt = gr.Textbox(label="Negative Prompt", value='')
1166
  with gr.Column():
1167
  result_gallery = gr.Gallery(label='Output', show_label=False, elem_id="gallery").style(grid=2,
1168
  height='auto')
@@ -1183,11 +1205,11 @@ with demo:
1183
  image_resolution = gr.Slider(label="Image Resolution", minimum=256, maximum=768, value=512,
1184
  step=64)
1185
  strength = gr.Slider(label="Control Strength", minimum=0.0, maximum=2.0, value=1.0, step=0.01)
1186
- condition_mode = gr.Checkbox(label='Condition Extraction', value=True)
1187
  guess_mode = gr.Checkbox(label='Guess Mode', value=False)
1188
  h_ratio = gr.Slider(label="Height Masking Ratio", minimum=20, maximum=80, value=50, step=1)
1189
  w_ratio = gr.Slider(label="Width Masking Ratio", minimum=20, maximum=80, value=50, step=1)
1190
- ddim_steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=30, step=1)
1191
  scale = gr.Slider(label="Guidance Scale", minimum=0.1, maximum=30.0, value=9.0, step=0.1)
1192
  seed = gr.Slider(label="Seed", minimum=-1, maximum=2147483647, step=1, randomize=True)
1193
  eta = gr.Number(label="eta (DDIM)", value=0.0)
@@ -1213,7 +1235,7 @@ with demo:
1213
  image_resolution = gr.Slider(label="Image Resolution", minimum=256, maximum=768, value=512,
1214
  step=64)
1215
  strength = gr.Slider(label="Control Strength", minimum=0.0, maximum=2.0, value=1.0, step=0.01)
1216
- condition_mode = gr.Checkbox(label='Condition Extraction', value=True)
1217
  guess_mode = gr.Checkbox(label='Guess Mode', value=False)
1218
  h_ratio_t = gr.Slider(label="Height Masking Ratio (Top)", minimum=20, maximum=80, value=50,
1219
  step=1)
@@ -1223,7 +1245,7 @@ with demo:
1223
  step=1)
1224
  w_ratio_r = gr.Slider(label="Width Masking Ratio (Right)", minimum=20, maximum=80, value=50,
1225
  step=1)
1226
- ddim_steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=30, step=1)
1227
  scale = gr.Slider(label="Guidance Scale", minimum=0.1, maximum=30.0, value=9.0, step=0.1)
1228
  seed = gr.Slider(label="Seed", minimum=-1, maximum=2147483647, step=1, randomize=True)
1229
  eta = gr.Number(label="eta (DDIM)", value=0.0)
@@ -1249,9 +1271,9 @@ with demo:
1249
  image_resolution = gr.Slider(label="Image Resolution", minimum=256, maximum=768, value=512,
1250
  step=64)
1251
  strength = gr.Slider(label="Control Strength", minimum=0.0, maximum=2.0, value=1.0, step=0.01)
1252
- condition_mode = gr.Checkbox(label='Condition Extraction', value=True)
1253
  guess_mode = gr.Checkbox(label='Guess Mode', value=False)
1254
- ddim_steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=30, step=1)
1255
  scale = gr.Slider(label="Guidance Scale", minimum=0.1, maximum=30.0, value=9.0, step=0.1)
1256
  seed = gr.Slider(label="Seed", minimum=-1, maximum=2147483647, step=1, randomize=True)
1257
  eta = gr.Number(label="eta (DDIM)", value=0.0)
@@ -1277,10 +1299,10 @@ with demo:
1277
  image_resolution = gr.Slider(label="Image Resolution", minimum=256, maximum=768, value=512,
1278
  step=64)
1279
  strength = gr.Slider(label="Control Strength", minimum=0.0, maximum=2.0, value=1.0, step=0.01)
1280
- condition_mode = gr.Checkbox(label='Condition Extraction', value=True)
1281
  guess_mode = gr.Checkbox(label='Guess Mode', value=False)
1282
  ksize = gr.Slider(label="Kernel Size", minimum=11, maximum=101, value=51, step=2)
1283
- ddim_steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=30, step=1)
1284
  scale = gr.Slider(label="Guidance Scale", minimum=0.1, maximum=30.0, value=9.0, step=0.1)
1285
  seed = gr.Slider(label="Seed", minimum=-1, maximum=2147483647, step=1, randomize=True)
1286
  eta = gr.Number(label="eta (DDIM)", value=0.0)
@@ -1292,5 +1314,8 @@ with demo:
1292
  ips = [input_image, prompt, a_prompt, n_prompt, num_samples, image_resolution, ddim_steps, guess_mode,
1293
  strength, scale, seed, eta, ksize, condition_mode]
1294
  run_button.click(fn=process_deblur, inputs=ips, outputs=[result_gallery])
1295
-
 
 
 
1296
  demo.launch()
 
926
 
927
  demo = gr.Blocks()
928
  with demo:
929
+ #gr.Markdown("UniControl Stable Diffusion Demo")
930
+ gr.HTML(
931
+ """
932
+ <div style="text-align: center; max-width: 1200px; margin: 20px auto;">
933
+ <h1 style="font-weight: 900; font-size: 3rem; margin: 0rem">
934
+ UniControl Stable Diffusion Demo
935
+ </h1>
936
+ <p style="font-size: 1rem; margin: 0rem">
937
+ Can Qin <sup>1,2</sup>, Shu Zhang<sup>1</sup>, Ning Yu <sup>1</sup>, Yihao Feng<sup>1</sup>, Xinyi Yang<sup>1</sup>, Yingbo Zhou <sup>1</sup>, Huan Wang <sup>1</sup>, Juan Carlos Niebles<sup>1</sup>, Caiming Xiong <sup>1</sup>, Silvio Savarese <sup>1</sup>, Stefano Ermon <sup>3</sup>, Yun Fu <sup>2</sup>, Ran Xu <sup>1</sup>
938
+ </p>
939
+ <p style="font-size: 0.8rem; margin: 0rem; line-height: 1em">
940
+ <sup>1</sup> Salesforce AI <sup>2</sup> Northeastern University <sup>3</sup> Stanford University \
941
+ Work done when Can Qin was an intern at Salesforce AI Research.
942
+ </p>
943
+ <p style="font-size: 0.9rem; margin: 0rem; line-height: 1.2em; margin-top:1em">
944
+ ONE model for AII the condition-to-image generation! \
945
+ <a href="https://github.com/salesforce/UniControl">[Github]</a>
946
+ <a href="https://canqin001.github.io/UniControl-Page/">[Website]</a>
947
+ <a href="https://arxiv.org/abs/2305.11147">[arXiv]</a>
948
+ </p>
949
+ </div>
950
+ """)
951
+
952
  with gr.Tabs():
953
  with gr.TabItem("Canny"):
954
  with gr.Row():
 
968
  low_threshold = gr.Slider(label="Canny low threshold", minimum=1, maximum=255, value=40, step=1)
969
  high_threshold = gr.Slider(label="Canny high threshold", minimum=1, maximum=255, value=200,
970
  step=1)
971
+ ddim_steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=20, step=1)
972
  scale = gr.Slider(label="Guidance Scale", minimum=0.1, maximum=30.0, value=9.0, step=0.1)
973
  seed = gr.Slider(label="Seed", minimum=-1, maximum=2147483647, step=1, randomize=True)
974
  eta = gr.Number(label="eta (DDIM)", value=0.0)
975
  a_prompt = gr.Textbox(label="Added Prompt", value='best quality, extremely detailed, bright')
976
+ n_prompt = gr.Textbox(label="Negative Prompt", value='longbody, lowres, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality')
977
  with gr.Column():
978
  result_gallery = gr.Gallery(label='Output', show_label=False, elem_id="gallery").style(grid=2,
979
  height='auto')
 
998
  guess_mode = gr.Checkbox(label='Guess Mode', value=False)
999
  detect_resolution = gr.Slider(label="HED Resolution", minimum=128, maximum=1024, value=512,
1000
  step=1)
1001
+ ddim_steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=20, step=1)
1002
  scale = gr.Slider(label="Guidance Scale", minimum=0.1, maximum=30.0, value=9.0, step=0.1)
1003
  seed = gr.Slider(label="Seed", minimum=-1, maximum=2147483647, step=1, randomize=True)
1004
  eta = gr.Number(label="eta (DDIM)", value=0.0)
1005
  a_prompt = gr.Textbox(label="Added Prompt", value='best quality, extremely detailed, bright')
1006
+ n_prompt = gr.Textbox(label="Negative Prompt", value='longbody, lowres, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality')
1007
  with gr.Column():
1008
  result_gallery = gr.Gallery(label='Output', show_label=False, elem_id="gallery").style(grid=2,
1009
  height='auto')
 
1024
  image_resolution = gr.Slider(label="Image Resolution", minimum=256, maximum=768, value=512,
1025
  step=64)
1026
  strength = gr.Slider(label="Control Strength", minimum=0.0, maximum=2.0, value=1.0, step=0.01)
1027
+ condition_mode = gr.Checkbox(label='Condition Extraction', value=False)
1028
  guess_mode = gr.Checkbox(label='Guess Mode', value=False)
1029
  detect_resolution = gr.Slider(label="HED Resolution", minimum=128, maximum=1024, value=512,
1030
  step=1)
1031
+ ddim_steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=20, step=1)
1032
  scale = gr.Slider(label="Guidance Scale", minimum=0.1, maximum=30.0, value=9.0, step=0.1)
1033
  seed = gr.Slider(label="Seed", minimum=-1, maximum=2147483647, step=1, randomize=True)
1034
  eta = gr.Number(label="eta (DDIM)", value=0.0)
1035
  a_prompt = gr.Textbox(label="Added Prompt", value='best quality, extremely detailed')
1036
+ n_prompt = gr.Textbox(label="Negative Prompt", value='longbody, lowres, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality')
1037
  with gr.Column():
1038
  result_gallery = gr.Gallery(label='Output', show_label=False, elem_id="gallery").style(grid=2,
1039
  height='auto')
 
1058
  guess_mode = gr.Checkbox(label='Guess Mode', value=False)
1059
  detect_resolution = gr.Slider(label="Depth Resolution", minimum=128, maximum=1024, value=384,
1060
  step=1)
1061
+ ddim_steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=20, step=1)
1062
  scale = gr.Slider(label="Guidance Scale", minimum=0.1, maximum=30.0, value=9.0, step=0.1)
1063
  seed = gr.Slider(label="Seed", minimum=-1, maximum=2147483647, step=1, randomize=True)
1064
  eta = gr.Number(label="eta (DDIM)", value=0.0)
1065
  a_prompt = gr.Textbox(label="Added Prompt", value='best quality, extremely detailed, bright')
1066
+ n_prompt = gr.Textbox(label="Negative Prompt", value='longbody, lowres, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality')
1067
  with gr.Column():
1068
  result_gallery = gr.Gallery(label='Output', show_label=False, elem_id="gallery").style(grid=2,
1069
  height='auto')
 
1088
  guess_mode = gr.Checkbox(label='Guess Mode', value=False)
1089
  detect_resolution = gr.Slider(label="Depth Resolution", minimum=128, maximum=1024, value=384,
1090
  step=1)
1091
+ ddim_steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=20, step=1)
1092
  scale = gr.Slider(label="Guidance Scale", minimum=0.1, maximum=30.0, value=9.0, step=0.1)
1093
  seed = gr.Slider(label="Seed", minimum=-1, maximum=2147483647, step=1, randomize=True)
1094
  eta = gr.Number(label="eta (DDIM)", value=0.0)
1095
  a_prompt = gr.Textbox(label="Added Prompt", value='best quality, extremely detailed, bright')
1096
+ n_prompt = gr.Textbox(label="Negative Prompt", value='longbody, lowres, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality')
1097
  with gr.Column():
1098
  result_gallery = gr.Gallery(label='Output', show_label=False, elem_id="gallery").style(grid=2,
1099
  height='auto')
 
1118
  guess_mode = gr.Checkbox(label='Guess Mode', value=False)
1119
  detect_resolution = gr.Slider(label="OpenPose Resolution", minimum=128, maximum=1024, value=512,
1120
  step=1)
1121
+ ddim_steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=20, step=1)
1122
  scale = gr.Slider(label="Guidance Scale", minimum=0.1, maximum=30.0, value=9.0, step=0.1)
1123
  seed = gr.Slider(label="Seed", minimum=-1, maximum=2147483647, step=1, randomize=True)
1124
  eta = gr.Number(label="eta (DDIM)", value=0.0)
1125
  a_prompt = gr.Textbox(label="Added Prompt", value='best quality, extremely detailed, bright')
1126
+ n_prompt = gr.Textbox(label="Negative Prompt", value='longbody, lowres, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality')
1127
  with gr.Column():
1128
  result_gallery = gr.Gallery(label='Output', show_label=False, elem_id="gallery").style(grid=2,
1129
  height='auto')
 
1148
  guess_mode = gr.Checkbox(label='Guess Mode', value=False)
1149
  detect_resolution = gr.Slider(label="Segmentation Resolution", minimum=128, maximum=1024,
1150
  value=512, step=1)
1151
+ ddim_steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=20, step=1)
1152
  scale = gr.Slider(label="Guidance Scale", minimum=0.1, maximum=30.0, value=9.0, step=0.1)
1153
  seed = gr.Slider(label="Seed", minimum=-1, maximum=2147483647, step=1, randomize=True)
1154
  eta = gr.Number(label="eta (DDIM)", value=0.0)
1155
  a_prompt = gr.Textbox(label="Added Prompt", value='best quality, extremely detailed, bright')
1156
+ n_prompt = gr.Textbox(label="Negative Prompt", value='longbody, lowres, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality')
1157
  with gr.Column():
1158
  result_gallery = gr.Gallery(label='Output', show_label=False, elem_id="gallery").style(grid=2,
1159
  height='auto')
 
1179
  confidence = gr.Slider(label="Confidence of Detection", minimum=0.1, maximum=1.0, value=0.4,
1180
  step=0.1)
1181
  nms_thresh = gr.Slider(label="Nms Threshold", minimum=0.1, maximum=1.0, value=0.5, step=0.1)
1182
+ ddim_steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=20, step=1)
1183
  scale = gr.Slider(label="Guidance Scale", minimum=0.1, maximum=30.0, value=9.0, step=0.1)
1184
  seed = gr.Slider(label="Seed", minimum=-1, maximum=2147483647, step=1, randomize=True)
1185
  eta = gr.Number(label="eta (DDIM)", value=0.0)
1186
  a_prompt = gr.Textbox(label="Added Prompt", value='best quality, extremely detailed, bright')
1187
+ n_prompt = gr.Textbox(label="Negative Prompt", value='longbody, lowres, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality')
1188
  with gr.Column():
1189
  result_gallery = gr.Gallery(label='Output', show_label=False, elem_id="gallery").style(grid=2,
1190
  height='auto')
 
1205
  image_resolution = gr.Slider(label="Image Resolution", minimum=256, maximum=768, value=512,
1206
  step=64)
1207
  strength = gr.Slider(label="Control Strength", minimum=0.0, maximum=2.0, value=1.0, step=0.01)
1208
+ condition_mode = gr.Checkbox(label='Condition Extraction', value=False)
1209
  guess_mode = gr.Checkbox(label='Guess Mode', value=False)
1210
  h_ratio = gr.Slider(label="Height Masking Ratio", minimum=20, maximum=80, value=50, step=1)
1211
  w_ratio = gr.Slider(label="Width Masking Ratio", minimum=20, maximum=80, value=50, step=1)
1212
+ ddim_steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=20, step=1)
1213
  scale = gr.Slider(label="Guidance Scale", minimum=0.1, maximum=30.0, value=9.0, step=0.1)
1214
  seed = gr.Slider(label="Seed", minimum=-1, maximum=2147483647, step=1, randomize=True)
1215
  eta = gr.Number(label="eta (DDIM)", value=0.0)
 
1235
  image_resolution = gr.Slider(label="Image Resolution", minimum=256, maximum=768, value=512,
1236
  step=64)
1237
  strength = gr.Slider(label="Control Strength", minimum=0.0, maximum=2.0, value=1.0, step=0.01)
1238
+ condition_mode = gr.Checkbox(label='Condition Extraction', value=False)
1239
  guess_mode = gr.Checkbox(label='Guess Mode', value=False)
1240
  h_ratio_t = gr.Slider(label="Height Masking Ratio (Top)", minimum=20, maximum=80, value=50,
1241
  step=1)
 
1245
  step=1)
1246
  w_ratio_r = gr.Slider(label="Width Masking Ratio (Right)", minimum=20, maximum=80, value=50,
1247
  step=1)
1248
+ ddim_steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=20, step=1)
1249
  scale = gr.Slider(label="Guidance Scale", minimum=0.1, maximum=30.0, value=9.0, step=0.1)
1250
  seed = gr.Slider(label="Seed", minimum=-1, maximum=2147483647, step=1, randomize=True)
1251
  eta = gr.Number(label="eta (DDIM)", value=0.0)
 
1271
  image_resolution = gr.Slider(label="Image Resolution", minimum=256, maximum=768, value=512,
1272
  step=64)
1273
  strength = gr.Slider(label="Control Strength", minimum=0.0, maximum=2.0, value=1.0, step=0.01)
1274
+ condition_mode = gr.Checkbox(label='Condition Extraction', value=False)
1275
  guess_mode = gr.Checkbox(label='Guess Mode', value=False)
1276
+ ddim_steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=20, step=1)
1277
  scale = gr.Slider(label="Guidance Scale", minimum=0.1, maximum=30.0, value=9.0, step=0.1)
1278
  seed = gr.Slider(label="Seed", minimum=-1, maximum=2147483647, step=1, randomize=True)
1279
  eta = gr.Number(label="eta (DDIM)", value=0.0)
 
1299
  image_resolution = gr.Slider(label="Image Resolution", minimum=256, maximum=768, value=512,
1300
  step=64)
1301
  strength = gr.Slider(label="Control Strength", minimum=0.0, maximum=2.0, value=1.0, step=0.01)
1302
+ condition_mode = gr.Checkbox(label='Condition Extraction', value=False)
1303
  guess_mode = gr.Checkbox(label='Guess Mode', value=False)
1304
  ksize = gr.Slider(label="Kernel Size", minimum=11, maximum=101, value=51, step=2)
1305
+ ddim_steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=20, step=1)
1306
  scale = gr.Slider(label="Guidance Scale", minimum=0.1, maximum=30.0, value=9.0, step=0.1)
1307
  seed = gr.Slider(label="Seed", minimum=-1, maximum=2147483647, step=1, randomize=True)
1308
  eta = gr.Number(label="eta (DDIM)", value=0.0)
 
1314
  ips = [input_image, prompt, a_prompt, n_prompt, num_samples, image_resolution, ddim_steps, guess_mode,
1315
  strength, scale, seed, eta, ksize, condition_mode]
1316
  run_button.click(fn=process_deblur, inputs=ips, outputs=[result_gallery])
1317
+ gr.Markdown('''### Related Spaces
1318
+ - https://huggingface.co/spaces/hysts/ControlNet
1319
+ - https://huggingface.co/spaces/shi-labs/Prompt-Free-Diffusion
1320
+ ''')
1321
  demo.launch()