HelloSun commited on
Commit
8707dcd
1 Parent(s): 6c29290

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -16,16 +16,17 @@ pipeline = OVLatentConsistencyModelPipeline.from_pretrained(model_id, compile=Fa
16
 
17
  batch_size, num_images, height, width = 1, 1, 512, 512
18
  pipeline.reshape(batch_size=batch_size, height=height, width=width, num_images_per_prompt=num_images)
 
19
  pipeline.compile()
20
 
21
  #TypeError: LatentConsistencyPipelineMixin.__call__() got an unexpected keyword argument 'negative_prompt'
22
  #negative_prompt="easynegative,bad anatomy, bad hands, missing fingers, extra fingers, three hands, three legs, bad arms, missing legs, missing arms, poorly drawn face, bad face, fused face, cloned face, three crus, fused feet, fused thigh, extra crus, ugly fingers, horn, cartoon, cg, 3d, unreal, animate, amputation, disconnected limbs, nsfw, nude, censored, "
23
-
24
- def infer(prompt, num_inference_steps):
25
 
26
  image = pipeline(
27
  prompt = prompt,
28
- #negative_prompt = negative_prompt, #no negative_prompt keyword in LatentConsistencyPipelineMixin
29
  # guidance_scale = guidance_scale,
30
  num_inference_steps = num_inference_steps,
31
  width = width,
@@ -96,7 +97,7 @@ with gr.Blocks(css=css) as demo:
96
 
97
  run_button.click(
98
  fn = infer,
99
- inputs = [prompt, num_inference_steps],
100
  outputs = [result]
101
  )
102
 
 
16
 
17
  batch_size, num_images, height, width = 1, 1, 512, 512
18
  pipeline.reshape(batch_size=batch_size, height=height, width=width, num_images_per_prompt=num_images)
19
+ pipe.load_textual_inversion("./badhandv4.pt", "badhandv4")
20
  pipeline.compile()
21
 
22
  #TypeError: LatentConsistencyPipelineMixin.__call__() got an unexpected keyword argument 'negative_prompt'
23
  #negative_prompt="easynegative,bad anatomy, bad hands, missing fingers, extra fingers, three hands, three legs, bad arms, missing legs, missing arms, poorly drawn face, bad face, fused face, cloned face, three crus, fused feet, fused thigh, extra crus, ugly fingers, horn, cartoon, cg, 3d, unreal, animate, amputation, disconnected limbs, nsfw, nude, censored, "
24
+ negative_prompt=""
25
+ def infer(prompt, negative_prompt, num_inference_steps):
26
 
27
  image = pipeline(
28
  prompt = prompt,
29
+ negative_prompt = negative_prompt,
30
  # guidance_scale = guidance_scale,
31
  num_inference_steps = num_inference_steps,
32
  width = width,
 
97
 
98
  run_button.click(
99
  fn = infer,
100
+ inputs = [prompt, negative_prompt, num_inference_steps],
101
  outputs = [result]
102
  )
103