Skip to content

Commit

Permalink
Update pipeline_flax_stable_diffusion_controlnet.py (#3306)
Browse files Browse the repository at this point in the history
Update pipeline_flax_controlnet.py

Change type of images array from jax.numpy.array to numpy.ndarray to permit in-place modification of the array when the safety checker detects a NSFW image.
  • Loading branch information
jfozard committed Jun 13, 2023
1 parent 34d14d7 commit ce55049
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -464,7 +464,7 @@ def __call__(

images_uint8_casted = np.asarray(images_uint8_casted).reshape(num_devices * batch_size, height, width, 3)
images_uint8_casted, has_nsfw_concept = self._run_safety_checker(images_uint8_casted, safety_params, jit)
images = np.asarray(images)
images = np.array(images)

# block images
if any(has_nsfw_concept):
Expand Down

0 comments on commit ce55049

Please sign in to comment.