lixiang46 commited on
Commit
9cdf8f2
1 Parent(s): 95ce3cf
Files changed (1) hide show
  1. app.py +13 -9
app.py CHANGED
@@ -45,6 +45,8 @@ pipe_depth = StableDiffusionXLControlNetImg2ImgPipeline(
45
  tokenizer=tokenizer,
46
  unet=unet,
47
  scheduler=scheduler,
 
 
48
  force_zeros_for_empty_prompt=False
49
  )
50
 
@@ -55,6 +57,8 @@ pipe_canny = StableDiffusionXLControlNetImg2ImgPipeline(
55
  tokenizer=tokenizer,
56
  unet=unet,
57
  scheduler=scheduler,
 
 
58
  force_zeros_for_empty_prompt=False
59
  )
60
 
@@ -92,12 +96,12 @@ MAX_IMAGE_SIZE = 1024
92
  def infer_depth(prompt,
93
  image = None,
94
  ipa_img = None,
95
- negative_prompt = "nsfw,脸部阴影,低分辨率,jpeg伪影、模糊、糟糕,黑脸,霓虹灯",
96
  seed = 397886929,
97
  randomize_seed = False,
98
- guidance_scale = 6.0,
99
  num_inference_steps = 50,
100
- controlnet_conditioning_scale = 0.7,
101
  control_guidance_end = 0.9,
102
  strength = 1.0,
103
  ip_scale = 0.5,
@@ -129,12 +133,12 @@ def infer_depth(prompt,
129
  def infer_canny(prompt,
130
  image = None,
131
  ipa_img = None,
132
- negative_prompt = "nsfw,脸部阴影,低分辨率,jpeg伪影、模糊、糟糕,黑脸,霓虹灯",
133
  seed = 397886929,
134
  randomize_seed = False,
135
- guidance_scale = 6.0,
136
  num_inference_steps = 50,
137
- controlnet_conditioning_scale = 0.7,
138
  control_guidance_end = 0.9,
139
  strength = 1.0,
140
  ip_scale = 0.5,
@@ -209,7 +213,7 @@ with gr.Blocks(css=css) as Kolors:
209
  label="Negative prompt",
210
  placeholder="Enter a negative prompt",
211
  visible=True,
212
- value="nsfw,脸部阴影,低分辨率,jpeg伪影、模糊、糟糕,黑脸,霓虹灯"
213
  )
214
  seed = gr.Slider(
215
  label="Seed",
@@ -225,7 +229,7 @@ with gr.Blocks(css=css) as Kolors:
225
  minimum=0.0,
226
  maximum=10.0,
227
  step=0.1,
228
- value=6.0,
229
  )
230
  num_inference_steps = gr.Slider(
231
  label="Number of inference steps",
@@ -240,7 +244,7 @@ with gr.Blocks(css=css) as Kolors:
240
  minimum=0.0,
241
  maximum=1.0,
242
  step=0.1,
243
- value=0.7,
244
  )
245
  control_guidance_end = gr.Slider(
246
  label="Control Guidance End",
 
45
  tokenizer=tokenizer,
46
  unet=unet,
47
  scheduler=scheduler,
48
+ image_encoder=image_encoder,
49
+ feature_extractor=clip_image_processor,
50
  force_zeros_for_empty_prompt=False
51
  )
52
 
 
57
  tokenizer=tokenizer,
58
  unet=unet,
59
  scheduler=scheduler,
60
+ image_encoder=image_encoder,
61
+ feature_extractor=clip_image_processor,
62
  force_zeros_for_empty_prompt=False
63
  )
64
 
 
96
  def infer_depth(prompt,
97
  image = None,
98
  ipa_img = None,
99
+ negative_prompt = "nsfw,脸部阴影,低分辨率,糟糕的解剖结构、糟糕的手,缺失手指、质量最差、低质量、jpeg伪影、模糊、糟糕,黑脸,霓虹灯",
100
  seed = 397886929,
101
  randomize_seed = False,
102
+ guidance_scale = 5.0,
103
  num_inference_steps = 50,
104
+ controlnet_conditioning_scale = 0.5,
105
  control_guidance_end = 0.9,
106
  strength = 1.0,
107
  ip_scale = 0.5,
 
133
  def infer_canny(prompt,
134
  image = None,
135
  ipa_img = None,
136
+ negative_prompt = "nsfw,脸部阴影,低分辨率,糟糕的解剖结构、糟糕的手,缺失手指、质量最差、低质量、jpeg伪影、模糊、糟糕,黑脸,霓虹灯",
137
  seed = 397886929,
138
  randomize_seed = False,
139
+ guidance_scale = 5.0,
140
  num_inference_steps = 50,
141
+ controlnet_conditioning_scale = 0.5,
142
  control_guidance_end = 0.9,
143
  strength = 1.0,
144
  ip_scale = 0.5,
 
213
  label="Negative prompt",
214
  placeholder="Enter a negative prompt",
215
  visible=True,
216
+ value="nsfw,脸部阴影,低分辨率,糟糕的解剖结构、糟糕的手,缺失手指、质量最差、低质量、jpeg伪影、模糊、糟糕,黑脸,霓虹灯"
217
  )
218
  seed = gr.Slider(
219
  label="Seed",
 
229
  minimum=0.0,
230
  maximum=10.0,
231
  step=0.1,
232
+ value=5.0,
233
  )
234
  num_inference_steps = gr.Slider(
235
  label="Number of inference steps",
 
244
  minimum=0.0,
245
  maximum=1.0,
246
  step=0.1,
247
+ value=0.5,
248
  )
249
  control_guidance_end = gr.Slider(
250
  label="Control Guidance End",