Skip to content

Commit ce55049

Browse files
authored
Update pipeline_flax_stable_diffusion_controlnet.py (#3306)
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.
1 parent 34d14d7 commit ce55049

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/diffusers/pipelines/controlnet/pipeline_flax_controlnet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ def __call__(
464464

465465
images_uint8_casted = np.asarray(images_uint8_casted).reshape(num_devices * batch_size, height, width, 3)
466466
images_uint8_casted, has_nsfw_concept = self._run_safety_checker(images_uint8_casted, safety_params, jit)
467-
images = np.asarray(images)
467+
images = np.array(images)
468468

469469
# block images
470470
if any(has_nsfw_concept):

0 commit comments

Comments
 (0)