Skip to content

Update pipeline_flax_stable_diffusion_controlnet.py #3306

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 13, 2023

Conversation

jfozard
Copy link
Contributor

@jfozard jfozard commented May 1, 2023

np.asarray makes a read-only copy of a jax array. This then breaks at line 473 if a nsfw image is detected

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented May 1, 2023

The documentation is not available anymore as the PR was closed or merged.

@patrickvonplaten patrickvonplaten requested a review from yiyixuxu May 3, 2023 12:56
@patrickvonplaten
Copy link
Contributor

@yiyixuxu can you check?

@github-actions github-actions bot added the stale Issues that haven't received updates label May 31, 2023
@yiyixuxu yiyixuxu removed the stale Issues that haven't received updates label Jun 1, 2023
@github-actions github-actions bot closed this Jun 9, 2023
@huggingface huggingface deleted a comment from github-actions bot Jun 12, 2023
@patrickvonplaten
Copy link
Contributor

Gentle ping @yiyixuxu - we can also just leave this one stale for now and ask for help from the community if you prefer

@jfozard
Copy link
Contributor Author

jfozard commented Jun 12, 2023

It was just a quick fix for the jax-diffusers hackathon.
In other discussions on the discord forums I've seen the suggestion (from Mateo Fidabel) to change l473 to images.at[i].set(images_uint8_casted[i])
Which is preferable depends on whether the pipeline should return a jax array or a numpy ndarray.

@yiyixuxu
Copy link
Collaborator

@jfozard I think it's good. can you resolve the conflicts and make sure all the tests pass?

@jfozard jfozard closed this Jun 12, 2023
@jfozard jfozard force-pushed the patch-1 branch 2 times, most recently from a753cc5 to 34d14d7 Compare June 12, 2023 22:26
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.
@jfozard
Copy link
Contributor Author

jfozard commented Jun 12, 2023

Sorry - I reverted the commit in my branch using the github interface, and didn't realize this would close the PR.

@jfozard jfozard reopened this Jun 12, 2023
@yiyixuxu yiyixuxu merged commit ce55049 into huggingface:main Jun 13, 2023
yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request Dec 25, 2023
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.
AmericanPresidentJimmyCarter pushed a commit to AmericanPresidentJimmyCarter/diffusers that referenced this pull request Apr 26, 2024
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants