Thafx commited on
Commit
e8ffb1f
1 Parent(s): abd6f83

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -67,6 +67,7 @@ def txt_to_img(prompt, neg_prompt, guidance, steps, width, height, generator):
67
 
68
  result = pipe(
69
  prompt,
 
70
  negative_prompt = neg_prompt,
71
  num_inference_steps = int(steps),
72
  guidance_scale = guidance,
@@ -74,7 +75,7 @@ def txt_to_img(prompt, neg_prompt, guidance, steps, width, height, generator):
74
  height = height,
75
  generator = generator)
76
 
77
- return result.imagesimage = pipe(prompt, safety_checker=None).images[0]
78
 
79
  def img_to_img(prompt, neg_prompt, img, strength, guidance, steps, width, height, generator):
80
 
@@ -82,6 +83,7 @@ def img_to_img(prompt, neg_prompt, img, strength, guidance, steps, width, height
82
  img = img.resize((int(img.width * ratio), int(img.height * ratio)), Image.LANCZOS)
83
  result = pipe_i2i(
84
  prompt,
 
85
  negative_prompt = neg_prompt,
86
  init_image = img,
87
  num_inference_steps = int(steps),
 
67
 
68
  result = pipe(
69
  prompt,
70
+ safety_checker = none,
71
  negative_prompt = neg_prompt,
72
  num_inference_steps = int(steps),
73
  guidance_scale = guidance,
 
75
  height = height,
76
  generator = generator)
77
 
78
+ return result.images[0]
79
 
80
  def img_to_img(prompt, neg_prompt, img, strength, guidance, steps, width, height, generator):
81
 
 
83
  img = img.resize((int(img.width * ratio), int(img.height * ratio)), Image.LANCZOS)
84
  result = pipe_i2i(
85
  prompt,
86
+ safety_checker = none,
87
  negative_prompt = neg_prompt,
88
  init_image = img,
89
  num_inference_steps = int(steps),