File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
python_coreml_stable_diffusion Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -195,6 +195,9 @@ def run_safety_checker(self, image):
195
195
196
196
return image , has_nsfw_concept
197
197
198
+ def run_null_checker (self , image ):
199
+ return image , None
200
+
198
201
def decode_latents (self , latents ):
199
202
latents = 1 / 0.18215 * latents
200
203
image = self .vae_decoder (z = latents .astype (np .float16 ))["image" ]
@@ -354,7 +357,8 @@ def __call__(
354
357
image = self .decode_latents (latents )
355
358
356
359
# 9. Run safety checker
357
- image , has_nsfw_concept = self .run_safety_checker (image )
360
+ # image, has_nsfw_concept = self.run_safety_checker(image)
361
+ image , has_nsfw_concept = self .run_null_checker (image )
358
362
359
363
# 10. Convert to PIL
360
364
if output_type == "pil" :
You can’t perform that action at this time.
0 commit comments