Xuanyou commited on
Commit
41b9e61
·
verified ·
1 Parent(s): 3b2c50e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -6
app.py CHANGED
@@ -242,7 +242,12 @@ def spirit_animal_baseline(image_path, num_images = 4):
242
  for _ in range(num_images):
243
  images = pipe_controlnet(
244
  prompt=prompt,
245
- negative_prompt="multiple heads, extra limbs, duplicate faces, mutated anatomy, disfigured, blurry",
 
 
 
 
 
246
  num_inference_steps=20,
247
  image=pose_pil,
248
  guidance_scale=5,
@@ -329,7 +334,12 @@ def spirit_animal_with_background(image_path, num_images = 4):
329
  for _ in range(num_images):
330
  images = pipe_inpaint_controlnet(
331
  prompt=prompt,
332
- negative_prompt="multiple heads, extra limbs, duplicate faces, mutated anatomy, disfigured, blurry",
 
 
 
 
 
333
  num_inference_steps=20,
334
  image=Image.fromarray(image_rgb),
335
  mask_image=expanded_mask,
@@ -392,10 +402,12 @@ def generate_multiple_animals(image_path, keep_background=True, num_images = 4):
392
  if 'choices' in response_json and len(response_json['choices']) > 0:
393
  content = response_json['choices'][0]['message']['content']
394
  prompts = [prompt.strip() for prompt in content.strip().split('.') if prompt.strip()]
395
- negative_prompt = (
396
- "multiple heads, extra limbs, duplicate faces, mutated anatomy, disfigured, "
397
- "blurry, deformed, text, watermark, logo, low resolution"
398
- )
 
 
399
  formatted_prompts = "\n".join(f"{i+1}. {prompt}" for i, prompt in enumerate(prompts))
400
 
401
  with mp_pose.Pose(static_image_mode=True) as pose:
 
242
  for _ in range(num_images):
243
  images = pipe_controlnet(
244
  prompt=prompt,
245
+ negative_prompt=(
246
+ "multiple heads, two heads, double head, triple head, extra limbs, extra arms, extra legs, "
247
+ "duplicate faces, multiple faces, mutated anatomy, deformed, disfigured, malformed, "
248
+ "extra ears, fused ears, blurred, low resolution, cartoonish, watermark, text, logo, "
249
+ "poorly drawn, distorted, floating limbs, out-of-frame"
250
+ ),
251
  num_inference_steps=20,
252
  image=pose_pil,
253
  guidance_scale=5,
 
334
  for _ in range(num_images):
335
  images = pipe_inpaint_controlnet(
336
  prompt=prompt,
337
+ negative_prompt=(
338
+ "multiple heads, two heads, double head, triple head, extra limbs, extra arms, extra legs, "
339
+ "duplicate faces, multiple faces, mutated anatomy, deformed, disfigured, malformed, "
340
+ "extra ears, fused ears, blurred, low resolution, cartoonish, watermark, text, logo, "
341
+ "poorly drawn, distorted, floating limbs, out-of-frame"
342
+ ),
343
  num_inference_steps=20,
344
  image=Image.fromarray(image_rgb),
345
  mask_image=expanded_mask,
 
402
  if 'choices' in response_json and len(response_json['choices']) > 0:
403
  content = response_json['choices'][0]['message']['content']
404
  prompts = [prompt.strip() for prompt in content.strip().split('.') if prompt.strip()]
405
+ negative_prompt=(
406
+ "multiple heads, two heads, double head, triple head, extra limbs, extra arms, extra legs, "
407
+ "duplicate faces, multiple faces, mutated anatomy, deformed, disfigured, malformed, "
408
+ "extra ears, fused ears, blurred, low resolution, cartoonish, watermark, text, logo, "
409
+ "poorly drawn, distorted, floating limbs, out-of-frame")
410
+
411
  formatted_prompts = "\n".join(f"{i+1}. {prompt}" for i, prompt in enumerate(prompts))
412
 
413
  with mp_pose.Pose(static_image_mode=True) as pose: