-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Fix wrong repeat of negative prompt #1035
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
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. |
|
Im not sure whats wrong with code quality. |
Have you tried running
|
|
Anther formatting way is to run make style |
|
@pcuenca Yes, I checked and change is same, but I fixed all (at least what I found) pipes. |
|
@Thomas-MMJ Whitespace was removed by vs code and I considered its fine. |
It just happens to be the style standard used for this code base. There are a variety of essentially arbitrary choices for consistency in style and this happens to be one. |
pcuenca
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! It's the same as the other PR but includes all the pipelines.
The only thing remaining would be to create some tests, as outlined by @patil-suraj here: #1002 (review).
@hadaev8 will you have time to work on it? Otherwise happy to take it :)
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py
Outdated
Show resolved
Hide resolved
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint_legacy.py
Outdated
Show resolved
Hide resolved
patil-suraj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this! I have same comments as @pcuenca, good for merge once those are resolved.
|
@pcuenca |
|
@hadaev8 For now I'd use something like maybe https://github.com/huggingface/diffusers/blob/main/tests/test_pipelines.py#L265 to exercise a small pipeline with different inputs, and verify that no exceptions are raised and the number of images returned is correct. These tests would include all the cases:
A better test would be to actually run a full stable diffusion pipeline and verify some slice of the results, but this is somewhat more involved and could be done later in my opinion. |
|
Running the fast and slow tests locally. |
|
@pcuenca So about this reshape, if repeat doesnt suit, where should be another function to avoid reshaping. Maybe expand or something. How do you think, does it make sense for another pr or leave it as it is? |
* remove batch size from repeat * repeat empty string if uncond_tokens is none * fix inpaint pipes * return back whitespace to pass code quality * Apply suggestions from code review * Fix typos. Co-authored-by: Had <[email protected]>
|
Continued in #1120 |
* remove batch size from repeat * repeat empty string if uncond_tokens is none * fix inpaint pipes * return back whitespace to pass code quality * Apply suggestions from code review * Fix typos. Co-authored-by: Had <[email protected]>
With current codebase this snippet would return error
Number of positive and negative prompts already checked in line
elif batch_size != len(negative_prompt):So no reason to repeat it by batch size.