"examples/pytorch/git@developer.sourcefind.cn:OpenDAS/dgl.git" did not exist on "6105e441426f97f31d96c54d6f35830028c2b3f6"
Unverified Commit ce550493 authored by jfozard's avatar jfozard Committed by GitHub
Browse files

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.
parent 34d14d78
...@@ -464,7 +464,7 @@ class FlaxStableDiffusionControlNetPipeline(FlaxDiffusionPipeline): ...@@ -464,7 +464,7 @@ class FlaxStableDiffusionControlNetPipeline(FlaxDiffusionPipeline):
images_uint8_casted = np.asarray(images_uint8_casted).reshape(num_devices * batch_size, height, width, 3) 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_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 # block images
if any(has_nsfw_concept): if any(has_nsfw_concept):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment