Torch compile graph fix by patrickvonplaten · Pull Request #3286 · huggingface/diffusers (original) (raw)

patrickvonplaten

@patrickvonplaten

@patrickvonplaten

@patrickvonplaten

patrickvonplaten

@patrickvonplaten

patrickvonplaten

@patrickvonplaten

@patrickvonplaten

dg845 pushed a commit to dg845/diffusers that referenced this pull request

May 6, 2023

@patrickvonplaten @dg845

hari10599 pushed a commit to hari10599/diffusers that referenced this pull request

May 20, 2023

@patrickvonplaten @hari10599

patrickvonplaten added a commit that referenced this pull request

May 22, 2023

A pipeline object stores the results in images not in sample. Current code blocks don't work.

Co-authored-by: Sayak Paul spsayakpaul@gmail.com


Co-authored-by: yiyixuxu yixu@yis-macbook-pro.lan Co-authored-by: Sayak Paul spsayakpaul@gmail.com

Co-authored-by: Horace He horacehe2007@yahoo.com


Co-authored-by: Horace He horacehe2007@yahoo.com

fixed import statement

Fix missing variable assign

lol

Update build_documentation.yml

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

The argument upsample_size needs to be added to these modules to allow compatibility with other blocks that require this argument.

Due to how the option is named, it makes more sense to behave like this.

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Update README.md

Typo in docs

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Check for duplicate tokens

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

fix docstring

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

add fixed variance schedulers and lora loading

class prompts are now included in pre-encoding code max tokenizer length is now configurable embedding attention mask is now configurable


Co-authored-by: yiyixuxu <yixu310@gmail,com>

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Due to previous commit these tests were failing as height and width need to be passed into the prepare_mask_and_masked_image function, I have updated the code and added a height/width variable per unit test as it seemed more appropriate than the current hard coded solution

this unit test simply gets the input and resizes it into some that would fail (e.g. would throw a tensor mismatch error/not a mult of 8). Then passes it through the pipeline and verifies it produces output with correct dims w.r.t the passed height and width


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Fix typo in last code block. Correct "prommpts" to "prompt"

This reverts commit abe8d63.

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

add transformers to install


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Add omegaconfg

Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Update pr_tests.yml

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Pedro Cuenca pedro@huggingface.co

Co-authored-by: Pedro pedro@huggingface.co


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com Co-authored-by: Pedro Cuenca pedro@huggingface.co

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Signed-off-by: Asfiya Baig asfiyab@nvidia.com

Signed-off-by: Asfiya Baig asfiyab@nvidia.com


Signed-off-by: Asfiya Baig asfiyab@nvidia.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Fix incomplete docstrings for resnet.py

fix tiled vae bleand extent range

Small update to "Next steps" section:

Allow arbitrary aspect ratio in IFSuperResolutionPipeline by using the input image shape


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

this is required when you aren't applying 100% noise to the masked region, e.g. strength < 1.

inspired from the stable diffusion img2img pipeline, init latents are initialised by converting the init image into a VAE latent and adding noise (based upon the strength parameter passed in), e.g. random when strength = 1, or the init image at strength = 0.

still need to add correct regression values

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

created a return_image boolean and initialised to false


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com Co-authored-by: William Berman WLBberman@gmail.com

Added bugfix using f strings.


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Release large tensors in attention (as soon as they're no longer required). Reduces peak VRAM by nearly 2 GB for 1024x1024 (even after slicing), and the savings scale up with image size.

add min snr to text2img lora training script


Co-authored-by: yueyang.hyy yueyang.hyy@alibaba-inc.com

Co-authored-by: Sayak Paul spsayakpaul@gmail.com

Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Sayak Paul spsayakpaul@gmail.com Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Sayak Paul spsayakpaul@gmail.com

explicit view kernel size as number elements in flattened indices

They are already a part of push_tests.yml.

They are already performed on push.

For better control/filtering.

This test passes in my Mac (Ventura 13.3) but fails in the CI hardware (Ventura 13.2). I ran the local tests following the same steps that exist in the CI workflow.

So we can test.

Tests passed, go back to running on push.


Signed-off-by: Asfiya Baig asfiyab@nvidia.com Co-authored-by: Ilia Larchenko 41329713+IliaLarchenko@users.noreply.github.com Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com Co-authored-by: YiYi Xu yixu310@gmail.com Co-authored-by: yiyixuxu yixu@yis-macbook-pro.lan Co-authored-by: Sayak Paul spsayakpaul@gmail.com Co-authored-by: Horace He horacehe2007@yahoo.com Co-authored-by: Umar 55330742+mu94-csl@users.noreply.github.com Co-authored-by: Mylo 36931363+gitmylo@users.noreply.github.com Co-authored-by: Markus Pobitzer markuspobitzer@gmail.com Co-authored-by: Cheng Lu lucheng.lc15@gmail.com Co-authored-by: Steven Liu 59462357+stevhliu@users.noreply.github.com Co-authored-by: Isamu Isozaki isamu.website@gmail.com Co-authored-by: Cesar Aybar csaybar@gmail.com Co-authored-by: Will Rice will@spokestack.io Co-authored-by: Adrià Arrufat 1671644+arrufat@users.noreply.github.com Co-authored-by: Sanchit Gandhi 93869735+sanchit-gandhi@users.noreply.github.com Co-authored-by: At-sushi dkahw210@kyoto.zaq.ne.jp Co-authored-by: Lucca Zenóbio luccazen@gmail.com Co-authored-by: Lysandre Debut lysandre@huggingface.co Co-authored-by: Isotr0py 41363108+Isotr0py@users.noreply.github.com Co-authored-by: pdoane pdoane2@gmail.com Co-authored-by: Will Berman wlbberman@gmail.com Co-authored-by: yiyixuxu <yixu310@gmail,com> Co-authored-by: Rupert Menneer 71332436+rupertmenneer@users.noreply.github.com Co-authored-by: sudowind wfpkueecs@163.com Co-authored-by: Takuma Mori takuma104@gmail.com Co-authored-by: Stas Bekman stas00@users.noreply.github.com Co-authored-by: Pedro Cuenca pedro@huggingface.co Co-authored-by: Laureηt laurentfainsin@protonmail.com Co-authored-by: Jongwoo Han jongwooo.han@gmail.com Co-authored-by: asfiyab-nvidia 117682710+asfiyab-nvidia@users.noreply.github.com Co-authored-by: clarencechen clarencechenct@gmail.com Co-authored-by: Laureηt laurent@fainsin.bzh Co-authored-by: superlabs-dev 133080491+superlabs-dev@users.noreply.github.com Co-authored-by: Dev Aggarwal devxpy@gmail.com Co-authored-by: Vimarsh Chaturvedi vimarsh.c@gmail.com Co-authored-by: 7eu7d7 31194890+7eu7d7@users.noreply.github.com Co-authored-by: cmdr2 shashank.shekhar.global@gmail.com Co-authored-by: wfng92 43742196+wfng92@users.noreply.github.com Co-authored-by: Glaceon-Hyy ffheyy0017@gmail.com Co-authored-by: yueyang.hyy yueyang.hyy@alibaba-inc.com

dg845 pushed a commit to dg845/diffusers that referenced this pull request

May 23, 2023

A pipeline object stores the results in images not in sample. Current code blocks don't work.

Co-authored-by: Sayak Paul spsayakpaul@gmail.com


Co-authored-by: yiyixuxu yixu@yis-macbook-pro.lan Co-authored-by: Sayak Paul spsayakpaul@gmail.com

Co-authored-by: Horace He horacehe2007@yahoo.com


Co-authored-by: Horace He horacehe2007@yahoo.com

fixed import statement

Fix missing variable assign

lol

Update build_documentation.yml

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

The argument upsample_size needs to be added to these modules to allow compatibility with other blocks that require this argument.

Due to how the option is named, it makes more sense to behave like this.

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Update README.md

Typo in docs

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Check for duplicate tokens

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

fix docstring

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

add fixed variance schedulers and lora loading

class prompts are now included in pre-encoding code max tokenizer length is now configurable embedding attention mask is now configurable


Co-authored-by: yiyixuxu <yixu310@gmail,com>

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Due to previous commit these tests were failing as height and width need to be passed into the prepare_mask_and_masked_image function, I have updated the code and added a height/width variable per unit test as it seemed more appropriate than the current hard coded solution

this unit test simply gets the input and resizes it into some that would fail (e.g. would throw a tensor mismatch error/not a mult of 8). Then passes it through the pipeline and verifies it produces output with correct dims w.r.t the passed height and width


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Fix typo in last code block. Correct "prommpts" to "prompt"

This reverts commit abe8d63.

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

add transformers to install


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Add omegaconfg

Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Update pr_tests.yml

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Pedro Cuenca pedro@huggingface.co

Co-authored-by: Pedro pedro@huggingface.co


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com Co-authored-by: Pedro Cuenca pedro@huggingface.co

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Signed-off-by: Asfiya Baig asfiyab@nvidia.com

Signed-off-by: Asfiya Baig asfiyab@nvidia.com


Signed-off-by: Asfiya Baig asfiyab@nvidia.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Fix incomplete docstrings for resnet.py

fix tiled vae bleand extent range

Small update to "Next steps" section:

Allow arbitrary aspect ratio in IFSuperResolutionPipeline by using the input image shape


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

this is required when you aren't applying 100% noise to the masked region, e.g. strength < 1.

inspired from the stable diffusion img2img pipeline, init latents are initialised by converting the init image into a VAE latent and adding noise (based upon the strength parameter passed in), e.g. random when strength = 1, or the init image at strength = 0.

still need to add correct regression values

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

created a return_image boolean and initialised to false


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com Co-authored-by: William Berman WLBberman@gmail.com

Added bugfix using f strings.


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Release large tensors in attention (as soon as they're no longer required). Reduces peak VRAM by nearly 2 GB for 1024x1024 (even after slicing), and the savings scale up with image size.

add min snr to text2img lora training script


Co-authored-by: yueyang.hyy yueyang.hyy@alibaba-inc.com

Co-authored-by: Sayak Paul spsayakpaul@gmail.com

Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Sayak Paul spsayakpaul@gmail.com Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Sayak Paul spsayakpaul@gmail.com

explicit view kernel size as number elements in flattened indices

They are already a part of push_tests.yml.

They are already performed on push.

For better control/filtering.

This test passes in my Mac (Ventura 13.3) but fails in the CI hardware (Ventura 13.2). I ran the local tests following the same steps that exist in the CI workflow.

So we can test.

Tests passed, go back to running on push.


Signed-off-by: Asfiya Baig asfiyab@nvidia.com Co-authored-by: Ilia Larchenko 41329713+IliaLarchenko@users.noreply.github.com Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com Co-authored-by: YiYi Xu yixu310@gmail.com Co-authored-by: yiyixuxu yixu@yis-macbook-pro.lan Co-authored-by: Sayak Paul spsayakpaul@gmail.com Co-authored-by: Horace He horacehe2007@yahoo.com Co-authored-by: Umar 55330742+mu94-csl@users.noreply.github.com Co-authored-by: Mylo 36931363+gitmylo@users.noreply.github.com Co-authored-by: Markus Pobitzer markuspobitzer@gmail.com Co-authored-by: Cheng Lu lucheng.lc15@gmail.com Co-authored-by: Steven Liu 59462357+stevhliu@users.noreply.github.com Co-authored-by: Isamu Isozaki isamu.website@gmail.com Co-authored-by: Cesar Aybar csaybar@gmail.com Co-authored-by: Will Rice will@spokestack.io Co-authored-by: Adrià Arrufat 1671644+arrufat@users.noreply.github.com Co-authored-by: Sanchit Gandhi 93869735+sanchit-gandhi@users.noreply.github.com Co-authored-by: At-sushi dkahw210@kyoto.zaq.ne.jp Co-authored-by: Lucca Zenóbio luccazen@gmail.com Co-authored-by: Lysandre Debut lysandre@huggingface.co Co-authored-by: Isotr0py 41363108+Isotr0py@users.noreply.github.com Co-authored-by: pdoane pdoane2@gmail.com Co-authored-by: Will Berman wlbberman@gmail.com Co-authored-by: yiyixuxu <yixu310@gmail,com> Co-authored-by: Rupert Menneer 71332436+rupertmenneer@users.noreply.github.com Co-authored-by: sudowind wfpkueecs@163.com Co-authored-by: Takuma Mori takuma104@gmail.com Co-authored-by: Stas Bekman stas00@users.noreply.github.com Co-authored-by: Pedro Cuenca pedro@huggingface.co Co-authored-by: Laureηt laurentfainsin@protonmail.com Co-authored-by: Jongwoo Han jongwooo.han@gmail.com Co-authored-by: asfiyab-nvidia 117682710+asfiyab-nvidia@users.noreply.github.com Co-authored-by: clarencechen clarencechenct@gmail.com Co-authored-by: Laureηt laurent@fainsin.bzh Co-authored-by: superlabs-dev 133080491+superlabs-dev@users.noreply.github.com Co-authored-by: Dev Aggarwal devxpy@gmail.com Co-authored-by: Vimarsh Chaturvedi vimarsh.c@gmail.com Co-authored-by: 7eu7d7 31194890+7eu7d7@users.noreply.github.com Co-authored-by: cmdr2 shashank.shekhar.global@gmail.com Co-authored-by: wfng92 43742196+wfng92@users.noreply.github.com Co-authored-by: Glaceon-Hyy ffheyy0017@gmail.com Co-authored-by: yueyang.hyy yueyang.hyy@alibaba-inc.com

sayakpaul added a commit that referenced this pull request

May 26, 2023


Co-authored-by: Sayak Paul spsayakpaul@gmail.com

Looking at a longer ~16ep run, we see only good validation images after ~11ep:

https://wandb.ai/andsteing/controlnet_fill50k/runs/3j2hx6n8

Previously train_metrics[-1] was logged, resulting in very bumpy train metrics.

This makes only a very small difference (~1 min) with this model size, so removing the option introduced in cdb3cc.

Co-authored-by: Sayak Paul spsayakpaul@gmail.com


Co-authored-by: Sayak Paul spsayakpaul@gmail.com

Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Pedro Cuenca pedro@huggingface.co

Throw deprecation warning

Allow stable diffusion attend and excite pipeline to work with any size output image. Re: #2476, #2603

remvoe one line

add custom timesteps test

add custom timesteps descending order check

docs

timesteps -> custom_timesteps

can only pass one of num_inference_steps and timesteps

fix breaking change

Fix img2img processor with safety checker

Make sure correct timesteps are chosen for img2img

Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Pedro Cuenca pedro@huggingface.co

extract pipeline from log_validation

Adding act fn config to the unet timestep class embedding and conv activation.

The custom activation defaults to silu which is the default activation function for both the conv act and the timestep class embeddings so default behavior is not changed.

The only unet which use the custom activation is the stable diffusion latent upscaler https://huggingface.co/stabilityai/sd-x2-latent-upscaler/blob/main/unet/config.json (I ran a script against the hub to confirm). The latent upscaler does not use the conv activation nor the timestep class embeddings so we don't change its behavior.

This mimics the dtype cast for the standard time embeddings


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Signed-off-by: Asfiya Baig asfiyab@nvidia.com

Signed-off-by: Asfiya Baig asfiyab@nvidia.com

Signed-off-by: Asfiya Baig asfiyab@nvidia.com

  1. Update setting of cache directory
  2. Address comments: merge utils and pipeline code.
  3. Address comments: Add section in README

Signed-off-by: Asfiya Baig asfiyab@nvidia.com

Signed-off-by: Asfiya Baig asfiyab@nvidia.com


Signed-off-by: Asfiya Baig asfiyab@nvidia.com Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

⚙️chore(transformer_2d) update function signature for encoder_hidden_states


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: root fulong_ye@163.com

controlnet training center crop input images to multiple of 8

The pipeline code resizes inputs to multiples of 8. Not doing this resizing in the training script is causing the encoded image to have different height/width dimensions than the encoded conditioning image (which uses a separate encoder that's part of the controlnet model).

We resize and center crop the inputs to make sure they're the same size (as well as all other images in the batch). We also check that the initial resolution is a multiple of 8.


Co-authored-by: Nupur Kumari nupurkumari@Nupurs-MacBook-Pro.local Co-authored-by: Sayak Paul spsayakpaul@gmail.com Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com Co-authored-by: Nupur Kumari nupurkumari@nupurs-mbp.wifi.local.cmu.edu

Add missing newlines for rendering the links correctly

Signed-off-by: Ye, Xinyu xinyu.ye@intel.com

Signed-off-by: Ye, Xinyu xinyu.ye@intel.com

Signed-off-by: Ye, Xinyu xinyu.ye@intel.com

Signed-off-by: Ye, Xinyu xinyu.ye@intel.com

Signed-off-by: Ye, Xinyu xinyu.ye@intel.com


Signed-off-by: Ye, Xinyu xinyu.ye@intel.com

Fix inversion prompt broadcasting

deterministic algos

pass silence_dtype_warnings as kwarg

Signed-off-by: Asfiya Baig asfiyab@nvidia.com Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

fix from_flax

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Suraj Patil surajp815@gmail.com


Co-authored-by: Suraj Patil surajp815@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

fix bug

Revert "[Community Pipelines] Update lpw_stable_diffusion pipeline (#3197)"

This reverts commit 9965cb50eac12e397473f01535aab43aae76b4ab.

cast to weight dtype

adding enable_vae_tiling and disable_val_tiling functions

Add v1.1 docs

When the token used for textual inversion does not have any special symbols (e.g. it is not surrounded by <>), the tokenizer does not properly split the replacement tokens. Adding a space for the padding tokens fixes this.

sync cache version check from transformers


Co-authored-by: William Berman WLBberman@gmail.com


Co-authored-by: William Berman WLBberman@gmail.com

Write model card in controlnet training script.


Co-authored-by: njindal njindal@adobe.com

[Slow Test]: Cuda test fixes

Co-authored-by: njindal njindal@adobe.com

Remove required from tracker_project_name.

As observed by https://github.com/off99555 in https://github.com/huggingface/diffusers/issues/2695#issuecomment-1470755050, it already has a default value.


Co-authored-by: Sayak Paul spsayakpaul@gmail.com

Update repaint.mdx

accomodate to #1701

Co-authored-by: multimodalart joaopaulo.passos+multimodal@gmail.com

The pipeline is built as pipe but then used as pipeline.

Revert "Revert "[Community Pipelines] Update lpw_stable_diffusion pipeline" (#3201)"

This reverts commit 91a2a80eb2f98a9f64b9e287715add244dc6f2f3.

Co-authored-by: yiyixuxu yixu@yis-macbook-pro.lan

Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Pedro Cuenca pedro@huggingface.co

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Fix typos

This reverts commit b218062fed08d6cc164206d6cb852b2b7b00847a.

Add support for mask broadcasting

Update docs and tests

Align mask argument to mask_image

Remove height and width arguments

Suppress spurious warning by repeating image before latent to mask gen

add link to training script

Co-authored-by: yiyixuxu yixu@yis-macbook-pro.lan

The note-seq package throws an error on import because the default installed version of Ipython is not compatible with python 3.8 which we run in the CI. https://github.com/huggingface/diffusers/actions/runs/4830121056/jobs/8605954838#step:7:9

A pipeline object stores the results in images not in sample. Current code blocks don't work.

Co-authored-by: Sayak Paul spsayakpaul@gmail.com


Co-authored-by: yiyixuxu yixu@yis-macbook-pro.lan Co-authored-by: Sayak Paul spsayakpaul@gmail.com

Co-authored-by: Horace He horacehe2007@yahoo.com


Co-authored-by: Horace He horacehe2007@yahoo.com

fixed import statement

Fix missing variable assign

lol

Update build_documentation.yml

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

The argument upsample_size needs to be added to these modules to allow compatibility with other blocks that require this argument.

This reverts commit 10a174a12c82e6abd3d5a57665719a03dbb85ca7.

This reverts commit 1a58958ab4f024dbc4c90a6404c2e66210db6d00.

fix docstring

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

add fixed variance schedulers and lora loading

class prompts are now included in pre-encoding code max tokenizer length is now configurable embedding attention mask is now configurable


Co-authored-by: yiyixuxu <yixu310@gmail,com>

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Due to previous commit these tests were failing as height and width need to be passed into the prepare_mask_and_masked_image function, I have updated the code and added a height/width variable per unit test as it seemed more appropriate than the current hard coded solution

this unit test simply gets the input and resizes it into some that would fail (e.g. would throw a tensor mismatch error/not a mult of 8). Then passes it through the pipeline and verifies it produces output with correct dims w.r.t the passed height and width


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Fix typo in last code block. Correct "prommpts" to "prompt"

This reverts commit abe8d6311d4b7f5b9409ca709c7fabf80d06c1a9.

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

add transformers to install


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Add omegaconfg

Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Update pr_tests.yml

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Pedro Cuenca pedro@huggingface.co

Co-authored-by: Pedro pedro@huggingface.co


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com Co-authored-by: Pedro Cuenca pedro@huggingface.co

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Signed-off-by: Asfiya Baig asfiyab@nvidia.com

Signed-off-by: Asfiya Baig asfiyab@nvidia.com


Signed-off-by: Asfiya Baig asfiyab@nvidia.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Fix incomplete docstrings for resnet.py

fix tiled vae bleand extent range

Small update to "Next steps" section:

Allow arbitrary aspect ratio in IFSuperResolutionPipeline by using the input image shape


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

this is required when you aren't applying 100% noise to the masked region, e.g. strength < 1.

inspired from the stable diffusion img2img pipeline, init latents are initialised by converting the init image into a VAE latent and adding noise (based upon the strength parameter passed in), e.g. random when strength = 1, or the init image at strength = 0.

still need to add correct regression values

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

created a return_image boolean and initialised to false


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com Co-authored-by: William Berman WLBberman@gmail.com

Added bugfix using f strings.


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Release large tensors in attention (as soon as they're no longer required). Reduces peak VRAM by nearly 2 GB for 1024x1024 (even after slicing), and the savings scale up with image size.

add min snr to text2img lora training script


Co-authored-by: yueyang.hyy yueyang.hyy@alibaba-inc.com

Co-authored-by: Sayak Paul spsayakpaul@gmail.com

Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Sayak Paul spsayakpaul@gmail.com Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Sayak Paul spsayakpaul@gmail.com

explicit view kernel size as number elements in flattened indices

They are already a part of push_tests.yml.

They are already performed on push.

For better control/filtering.

This test passes in my Mac (Ventura 13.3) but fails in the CI hardware (Ventura 13.2). I ran the local tests following the same steps that exist in the CI workflow.

So we can test.

Tests passed, go back to running on push.

add note on local directory path.

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: StAlKeR7779 stalkek7779@yandex.ru


Co-authored-by: StAlKeR7779 stalkek7779@yandex.ru


Co-authored-by: Chanran Kim seriousran@gmail.com

Images may have rotations stored in EXIF. Training using such images will cause those transforms to be ignored while training and thus produce unexpected results

A pipeline object stores the results in images not in sample. Current code blocks don't work.

Co-authored-by: Sayak Paul spsayakpaul@gmail.com


Co-authored-by: yiyixuxu yixu@yis-macbook-pro.lan Co-authored-by: Sayak Paul spsayakpaul@gmail.com

Co-authored-by: Horace He horacehe2007@yahoo.com


Co-authored-by: Horace He horacehe2007@yahoo.com

fixed import statement

Fix missing variable assign

lol

Update build_documentation.yml

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

The argument upsample_size needs to be added to these modules to allow compatibility with other blocks that require this argument.

Due to how the option is named, it makes more sense to behave like this.

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Update README.md

Typo in docs

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Check for duplicate tokens

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

fix docstring

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

add fixed variance schedulers and lora loading

class prompts are now included in pre-encoding code max tokenizer length is now configurable embedding attention mask is now configurable


Co-authored-by: yiyixuxu <yixu310@gmail,com>

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Due to previous commit these tests were failing as height and width need to be passed into the prepare_mask_and_masked_image function, I have updated the code and added a height/width variable per unit test as it seemed more appropriate than the current hard coded solution

this unit test simply gets the input and resizes it into some that would fail (e.g. would throw a tensor mismatch error/not a mult of 8). Then passes it through the pipeline and verifies it produces output with correct dims w.r.t the passed height and width


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Fix typo in last code block. Correct "prommpts" to "prompt"

This reverts commit abe8d6311d4b7f5b9409ca709c7fabf80d06c1a9.

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

add transformers to install


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Add omegaconfg

Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Update pr_tests.yml

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Pedro Cuenca pedro@huggingface.co

Co-authored-by: Pedro pedro@huggingface.co


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com Co-authored-by: Pedro Cuenca pedro@huggingface.co

Co-authored-by: Patrick von Platen <patr…

yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request

Dec 25, 2023

@patrickvonplaten

yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request

Dec 25, 2023

A pipeline object stores the results in images not in sample. Current code blocks don't work.

Co-authored-by: Sayak Paul spsayakpaul@gmail.com


Co-authored-by: yiyixuxu yixu@yis-macbook-pro.lan Co-authored-by: Sayak Paul spsayakpaul@gmail.com

Co-authored-by: Horace He horacehe2007@yahoo.com


Co-authored-by: Horace He horacehe2007@yahoo.com

fixed import statement

Fix missing variable assign

lol

Update build_documentation.yml

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

The argument upsample_size needs to be added to these modules to allow compatibility with other blocks that require this argument.

Due to how the option is named, it makes more sense to behave like this.

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Update README.md

Typo in docs

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Check for duplicate tokens

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

fix docstring

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

add fixed variance schedulers and lora loading

class prompts are now included in pre-encoding code max tokenizer length is now configurable embedding attention mask is now configurable


Co-authored-by: yiyixuxu <yixu310@gmail,com>

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Due to previous commit these tests were failing as height and width need to be passed into the prepare_mask_and_masked_image function, I have updated the code and added a height/width variable per unit test as it seemed more appropriate than the current hard coded solution

this unit test simply gets the input and resizes it into some that would fail (e.g. would throw a tensor mismatch error/not a mult of 8). Then passes it through the pipeline and verifies it produces output with correct dims w.r.t the passed height and width


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Fix typo in last code block. Correct "prommpts" to "prompt"

This reverts commit abe8d63.

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

add transformers to install


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Add omegaconfg

Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Update pr_tests.yml

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Pedro Cuenca pedro@huggingface.co

Co-authored-by: Pedro pedro@huggingface.co


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com Co-authored-by: Pedro Cuenca pedro@huggingface.co

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Signed-off-by: Asfiya Baig asfiyab@nvidia.com

Signed-off-by: Asfiya Baig asfiyab@nvidia.com


Signed-off-by: Asfiya Baig asfiyab@nvidia.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Fix incomplete docstrings for resnet.py

fix tiled vae bleand extent range

Small update to "Next steps" section:

Allow arbitrary aspect ratio in IFSuperResolutionPipeline by using the input image shape


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

this is required when you aren't applying 100% noise to the masked region, e.g. strength < 1.

inspired from the stable diffusion img2img pipeline, init latents are initialised by converting the init image into a VAE latent and adding noise (based upon the strength parameter passed in), e.g. random when strength = 1, or the init image at strength = 0.

still need to add correct regression values

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

created a return_image boolean and initialised to false


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com Co-authored-by: William Berman WLBberman@gmail.com

Added bugfix using f strings.


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Release large tensors in attention (as soon as they're no longer required). Reduces peak VRAM by nearly 2 GB for 1024x1024 (even after slicing), and the savings scale up with image size.

add min snr to text2img lora training script


Co-authored-by: yueyang.hyy yueyang.hyy@alibaba-inc.com

Co-authored-by: Sayak Paul spsayakpaul@gmail.com

Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Sayak Paul spsayakpaul@gmail.com Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Sayak Paul spsayakpaul@gmail.com

explicit view kernel size as number elements in flattened indices

They are already a part of push_tests.yml.

They are already performed on push.

For better control/filtering.

This test passes in my Mac (Ventura 13.3) but fails in the CI hardware (Ventura 13.2). I ran the local tests following the same steps that exist in the CI workflow.

So we can test.

Tests passed, go back to running on push.


Signed-off-by: Asfiya Baig asfiyab@nvidia.com Co-authored-by: Ilia Larchenko 41329713+IliaLarchenko@users.noreply.github.com Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com Co-authored-by: YiYi Xu yixu310@gmail.com Co-authored-by: yiyixuxu yixu@yis-macbook-pro.lan Co-authored-by: Sayak Paul spsayakpaul@gmail.com Co-authored-by: Horace He horacehe2007@yahoo.com Co-authored-by: Umar 55330742+mu94-csl@users.noreply.github.com Co-authored-by: Mylo 36931363+gitmylo@users.noreply.github.com Co-authored-by: Markus Pobitzer markuspobitzer@gmail.com Co-authored-by: Cheng Lu lucheng.lc15@gmail.com Co-authored-by: Steven Liu 59462357+stevhliu@users.noreply.github.com Co-authored-by: Isamu Isozaki isamu.website@gmail.com Co-authored-by: Cesar Aybar csaybar@gmail.com Co-authored-by: Will Rice will@spokestack.io Co-authored-by: Adrià Arrufat 1671644+arrufat@users.noreply.github.com Co-authored-by: Sanchit Gandhi 93869735+sanchit-gandhi@users.noreply.github.com Co-authored-by: At-sushi dkahw210@kyoto.zaq.ne.jp Co-authored-by: Lucca Zenóbio luccazen@gmail.com Co-authored-by: Lysandre Debut lysandre@huggingface.co Co-authored-by: Isotr0py 41363108+Isotr0py@users.noreply.github.com Co-authored-by: pdoane pdoane2@gmail.com Co-authored-by: Will Berman wlbberman@gmail.com Co-authored-by: yiyixuxu <yixu310@gmail,com> Co-authored-by: Rupert Menneer 71332436+rupertmenneer@users.noreply.github.com Co-authored-by: sudowind wfpkueecs@163.com Co-authored-by: Takuma Mori takuma104@gmail.com Co-authored-by: Stas Bekman stas00@users.noreply.github.com Co-authored-by: Pedro Cuenca pedro@huggingface.co Co-authored-by: Laureηt laurentfainsin@protonmail.com Co-authored-by: Jongwoo Han jongwooo.han@gmail.com Co-authored-by: asfiyab-nvidia 117682710+asfiyab-nvidia@users.noreply.github.com Co-authored-by: clarencechen clarencechenct@gmail.com Co-authored-by: Laureηt laurent@fainsin.bzh Co-authored-by: superlabs-dev 133080491+superlabs-dev@users.noreply.github.com Co-authored-by: Dev Aggarwal devxpy@gmail.com Co-authored-by: Vimarsh Chaturvedi vimarsh.c@gmail.com Co-authored-by: 7eu7d7 31194890+7eu7d7@users.noreply.github.com Co-authored-by: cmdr2 shashank.shekhar.global@gmail.com Co-authored-by: wfng92 43742196+wfng92@users.noreply.github.com Co-authored-by: Glaceon-Hyy ffheyy0017@gmail.com Co-authored-by: yueyang.hyy yueyang.hyy@alibaba-inc.com

yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request

Dec 25, 2023


Co-authored-by: Sayak Paul spsayakpaul@gmail.com

Looking at a longer ~16ep run, we see only good validation images after ~11ep:

https://wandb.ai/andsteing/controlnet_fill50k/runs/3j2hx6n8

Previously train_metrics[-1] was logged, resulting in very bumpy train metrics.

This makes only a very small difference (~1 min) with this model size, so removing the option introduced in cdb3cc.

Co-authored-by: Sayak Paul spsayakpaul@gmail.com


Co-authored-by: Sayak Paul spsayakpaul@gmail.com

Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Pedro Cuenca pedro@huggingface.co

Throw deprecation warning

Allow stable diffusion attend and excite pipeline to work with any size output image. Re: #2476, #2603

remvoe one line

add custom timesteps test

add custom timesteps descending order check

docs

timesteps -> custom_timesteps

can only pass one of num_inference_steps and timesteps

fix breaking change

Fix img2img processor with safety checker

Make sure correct timesteps are chosen for img2img

Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Pedro Cuenca pedro@huggingface.co

extract pipeline from log_validation

Adding act fn config to the unet timestep class embedding and conv activation.

The custom activation defaults to silu which is the default activation function for both the conv act and the timestep class embeddings so default behavior is not changed.

The only unet which use the custom activation is the stable diffusion latent upscaler https://huggingface.co/stabilityai/sd-x2-latent-upscaler/blob/main/unet/config.json (I ran a script against the hub to confirm). The latent upscaler does not use the conv activation nor the timestep class embeddings so we don't change its behavior.

This mimics the dtype cast for the standard time embeddings


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Signed-off-by: Asfiya Baig asfiyab@nvidia.com

Signed-off-by: Asfiya Baig asfiyab@nvidia.com

Signed-off-by: Asfiya Baig asfiyab@nvidia.com

  1. Update setting of cache directory
  2. Address comments: merge utils and pipeline code.
  3. Address comments: Add section in README

Signed-off-by: Asfiya Baig asfiyab@nvidia.com

Signed-off-by: Asfiya Baig asfiyab@nvidia.com


Signed-off-by: Asfiya Baig asfiyab@nvidia.com Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

⚙️chore(transformer_2d) update function signature for encoder_hidden_states


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: root fulong_ye@163.com

controlnet training center crop input images to multiple of 8

The pipeline code resizes inputs to multiples of 8. Not doing this resizing in the training script is causing the encoded image to have different height/width dimensions than the encoded conditioning image (which uses a separate encoder that's part of the controlnet model).

We resize and center crop the inputs to make sure they're the same size (as well as all other images in the batch). We also check that the initial resolution is a multiple of 8.


Co-authored-by: Nupur Kumari nupurkumari@Nupurs-MacBook-Pro.local Co-authored-by: Sayak Paul spsayakpaul@gmail.com Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com Co-authored-by: Nupur Kumari nupurkumari@nupurs-mbp.wifi.local.cmu.edu

Add missing newlines for rendering the links correctly

Signed-off-by: Ye, Xinyu xinyu.ye@intel.com

Signed-off-by: Ye, Xinyu xinyu.ye@intel.com

Signed-off-by: Ye, Xinyu xinyu.ye@intel.com

Signed-off-by: Ye, Xinyu xinyu.ye@intel.com

Signed-off-by: Ye, Xinyu xinyu.ye@intel.com


Signed-off-by: Ye, Xinyu xinyu.ye@intel.com

Fix inversion prompt broadcasting

deterministic algos

pass silence_dtype_warnings as kwarg

Signed-off-by: Asfiya Baig asfiyab@nvidia.com Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

fix from_flax

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Suraj Patil surajp815@gmail.com


Co-authored-by: Suraj Patil surajp815@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

fix bug

Revert "[Community Pipelines] Update lpw_stable_diffusion pipeline (#3197)"

This reverts commit 9965cb50eac12e397473f01535aab43aae76b4ab.

cast to weight dtype

adding enable_vae_tiling and disable_val_tiling functions

Add v1.1 docs

When the token used for textual inversion does not have any special symbols (e.g. it is not surrounded by <>), the tokenizer does not properly split the replacement tokens. Adding a space for the padding tokens fixes this.

sync cache version check from transformers


Co-authored-by: William Berman WLBberman@gmail.com


Co-authored-by: William Berman WLBberman@gmail.com

Write model card in controlnet training script.


Co-authored-by: njindal njindal@adobe.com

[Slow Test]: Cuda test fixes

Co-authored-by: njindal njindal@adobe.com

Remove required from tracker_project_name.

As observed by https://github.com/off99555 in https://github.com/huggingface/diffusers/issues/2695#issuecomment-1470755050, it already has a default value.


Co-authored-by: Sayak Paul spsayakpaul@gmail.com

Update repaint.mdx

accomodate to #1701

Co-authored-by: multimodalart joaopaulo.passos+multimodal@gmail.com

The pipeline is built as pipe but then used as pipeline.

Revert "Revert "[Community Pipelines] Update lpw_stable_diffusion pipeline" (#3201)"

This reverts commit 91a2a80eb2f98a9f64b9e287715add244dc6f2f3.

Co-authored-by: yiyixuxu yixu@yis-macbook-pro.lan

Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Pedro Cuenca pedro@huggingface.co

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Fix typos

This reverts commit b218062fed08d6cc164206d6cb852b2b7b00847a.

Add support for mask broadcasting

Update docs and tests

Align mask argument to mask_image

Remove height and width arguments

Suppress spurious warning by repeating image before latent to mask gen

add link to training script

Co-authored-by: yiyixuxu yixu@yis-macbook-pro.lan

The note-seq package throws an error on import because the default installed version of Ipython is not compatible with python 3.8 which we run in the CI. https://github.com/huggingface/diffusers/actions/runs/4830121056/jobs/8605954838#step:7:9

A pipeline object stores the results in images not in sample. Current code blocks don't work.

Co-authored-by: Sayak Paul spsayakpaul@gmail.com


Co-authored-by: yiyixuxu yixu@yis-macbook-pro.lan Co-authored-by: Sayak Paul spsayakpaul@gmail.com

Co-authored-by: Horace He horacehe2007@yahoo.com


Co-authored-by: Horace He horacehe2007@yahoo.com

fixed import statement

Fix missing variable assign

lol

Update build_documentation.yml

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

The argument upsample_size needs to be added to these modules to allow compatibility with other blocks that require this argument.

This reverts commit 10a174a12c82e6abd3d5a57665719a03dbb85ca7.

This reverts commit 1a58958ab4f024dbc4c90a6404c2e66210db6d00.

fix docstring

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

add fixed variance schedulers and lora loading

class prompts are now included in pre-encoding code max tokenizer length is now configurable embedding attention mask is now configurable


Co-authored-by: yiyixuxu <yixu310@gmail,com>

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Due to previous commit these tests were failing as height and width need to be passed into the prepare_mask_and_masked_image function, I have updated the code and added a height/width variable per unit test as it seemed more appropriate than the current hard coded solution

this unit test simply gets the input and resizes it into some that would fail (e.g. would throw a tensor mismatch error/not a mult of 8). Then passes it through the pipeline and verifies it produces output with correct dims w.r.t the passed height and width


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Fix typo in last code block. Correct "prommpts" to "prompt"

This reverts commit abe8d6311d4b7f5b9409ca709c7fabf80d06c1a9.

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

add transformers to install


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Add omegaconfg

Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Update pr_tests.yml

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Pedro Cuenca pedro@huggingface.co

Co-authored-by: Pedro pedro@huggingface.co


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com Co-authored-by: Pedro Cuenca pedro@huggingface.co

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Signed-off-by: Asfiya Baig asfiyab@nvidia.com

Signed-off-by: Asfiya Baig asfiyab@nvidia.com


Signed-off-by: Asfiya Baig asfiyab@nvidia.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Fix incomplete docstrings for resnet.py

fix tiled vae bleand extent range

Small update to "Next steps" section:

Allow arbitrary aspect ratio in IFSuperResolutionPipeline by using the input image shape


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

this is required when you aren't applying 100% noise to the masked region, e.g. strength < 1.

inspired from the stable diffusion img2img pipeline, init latents are initialised by converting the init image into a VAE latent and adding noise (based upon the strength parameter passed in), e.g. random when strength = 1, or the init image at strength = 0.

still need to add correct regression values

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

created a return_image boolean and initialised to false


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com Co-authored-by: William Berman WLBberman@gmail.com

Added bugfix using f strings.


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Release large tensors in attention (as soon as they're no longer required). Reduces peak VRAM by nearly 2 GB for 1024x1024 (even after slicing), and the savings scale up with image size.

add min snr to text2img lora training script


Co-authored-by: yueyang.hyy yueyang.hyy@alibaba-inc.com

Co-authored-by: Sayak Paul spsayakpaul@gmail.com

Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Sayak Paul spsayakpaul@gmail.com Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Sayak Paul spsayakpaul@gmail.com

explicit view kernel size as number elements in flattened indices

They are already a part of push_tests.yml.

They are already performed on push.

For better control/filtering.

This test passes in my Mac (Ventura 13.3) but fails in the CI hardware (Ventura 13.2). I ran the local tests following the same steps that exist in the CI workflow.

So we can test.

Tests passed, go back to running on push.

add note on local directory path.

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: StAlKeR7779 stalkek7779@yandex.ru


Co-authored-by: StAlKeR7779 stalkek7779@yandex.ru


Co-authored-by: Chanran Kim seriousran@gmail.com

Images may have rotations stored in EXIF. Training using such images will cause those transforms to be ignored while training and thus produce unexpected results

A pipeline object stores the results in images not in sample. Current code blocks don't work.

Co-authored-by: Sayak Paul spsayakpaul@gmail.com


Co-authored-by: yiyixuxu yixu@yis-macbook-pro.lan Co-authored-by: Sayak Paul spsayakpaul@gmail.com

Co-authored-by: Horace He horacehe2007@yahoo.com


Co-authored-by: Horace He horacehe2007@yahoo.com

fixed import statement

Fix missing variable assign

lol

Update build_documentation.yml

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

The argument upsample_size needs to be added to these modules to allow compatibility with other blocks that require this argument.

Due to how the option is named, it makes more sense to behave like this.

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Update README.md

Typo in docs

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Check for duplicate tokens

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

fix docstring

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

add fixed variance schedulers and lora loading

class prompts are now included in pre-encoding code max tokenizer length is now configurable embedding attention mask is now configurable


Co-authored-by: yiyixuxu <yixu310@gmail,com>

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Due to previous commit these tests were failing as height and width need to be passed into the prepare_mask_and_masked_image function, I have updated the code and added a height/width variable per unit test as it seemed more appropriate than the current hard coded solution

this unit test simply gets the input and resizes it into some that would fail (e.g. would throw a tensor mismatch error/not a mult of 8). Then passes it through the pipeline and verifies it produces output with correct dims w.r.t the passed height and width


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Fix typo in last code block. Correct "prommpts" to "prompt"

This reverts commit abe8d6311d4b7f5b9409ca709c7fabf80d06c1a9.

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

add transformers to install


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Add omegaconfg

Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Update pr_tests.yml

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Pedro Cuenca pedro@huggingface.co

Co-authored-by: Pedro pedro@huggingface.co


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com Co-authored-by: Pedro Cuenca pedro@huggingface.co

Co-authored-by: Patrick von Platen <patr…

AmericanPresidentJimmyCarter pushed a commit to AmericanPresidentJimmyCarter/diffusers that referenced this pull request

Apr 26, 2024

@patrickvonplaten

AmericanPresidentJimmyCarter pushed a commit to AmericanPresidentJimmyCarter/diffusers that referenced this pull request

Apr 26, 2024

A pipeline object stores the results in images not in sample. Current code blocks don't work.

Co-authored-by: Sayak Paul spsayakpaul@gmail.com


Co-authored-by: yiyixuxu yixu@yis-macbook-pro.lan Co-authored-by: Sayak Paul spsayakpaul@gmail.com

Co-authored-by: Horace He horacehe2007@yahoo.com


Co-authored-by: Horace He horacehe2007@yahoo.com

fixed import statement

Fix missing variable assign

lol

Update build_documentation.yml

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

The argument upsample_size needs to be added to these modules to allow compatibility with other blocks that require this argument.

Due to how the option is named, it makes more sense to behave like this.

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Update README.md

Typo in docs

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Check for duplicate tokens

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

fix docstring

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

add fixed variance schedulers and lora loading

class prompts are now included in pre-encoding code max tokenizer length is now configurable embedding attention mask is now configurable


Co-authored-by: yiyixuxu <yixu310@gmail,com>

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Due to previous commit these tests were failing as height and width need to be passed into the prepare_mask_and_masked_image function, I have updated the code and added a height/width variable per unit test as it seemed more appropriate than the current hard coded solution

this unit test simply gets the input and resizes it into some that would fail (e.g. would throw a tensor mismatch error/not a mult of 8). Then passes it through the pipeline and verifies it produces output with correct dims w.r.t the passed height and width


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Fix typo in last code block. Correct "prommpts" to "prompt"

This reverts commit abe8d63.

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

add transformers to install


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Add omegaconfg

Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Update pr_tests.yml

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Pedro Cuenca pedro@huggingface.co

Co-authored-by: Pedro pedro@huggingface.co


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com Co-authored-by: Pedro Cuenca pedro@huggingface.co

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Signed-off-by: Asfiya Baig asfiyab@nvidia.com

Signed-off-by: Asfiya Baig asfiyab@nvidia.com


Signed-off-by: Asfiya Baig asfiyab@nvidia.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Fix incomplete docstrings for resnet.py

fix tiled vae bleand extent range

Small update to "Next steps" section:

Allow arbitrary aspect ratio in IFSuperResolutionPipeline by using the input image shape


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

this is required when you aren't applying 100% noise to the masked region, e.g. strength < 1.

inspired from the stable diffusion img2img pipeline, init latents are initialised by converting the init image into a VAE latent and adding noise (based upon the strength parameter passed in), e.g. random when strength = 1, or the init image at strength = 0.

still need to add correct regression values

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

created a return_image boolean and initialised to false


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com Co-authored-by: William Berman WLBberman@gmail.com

Added bugfix using f strings.


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Release large tensors in attention (as soon as they're no longer required). Reduces peak VRAM by nearly 2 GB for 1024x1024 (even after slicing), and the savings scale up with image size.

add min snr to text2img lora training script


Co-authored-by: yueyang.hyy yueyang.hyy@alibaba-inc.com

Co-authored-by: Sayak Paul spsayakpaul@gmail.com

Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Sayak Paul spsayakpaul@gmail.com Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Sayak Paul spsayakpaul@gmail.com

explicit view kernel size as number elements in flattened indices

They are already a part of push_tests.yml.

They are already performed on push.

For better control/filtering.

This test passes in my Mac (Ventura 13.3) but fails in the CI hardware (Ventura 13.2). I ran the local tests following the same steps that exist in the CI workflow.

So we can test.

Tests passed, go back to running on push.


Signed-off-by: Asfiya Baig asfiyab@nvidia.com Co-authored-by: Ilia Larchenko 41329713+IliaLarchenko@users.noreply.github.com Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com Co-authored-by: YiYi Xu yixu310@gmail.com Co-authored-by: yiyixuxu yixu@yis-macbook-pro.lan Co-authored-by: Sayak Paul spsayakpaul@gmail.com Co-authored-by: Horace He horacehe2007@yahoo.com Co-authored-by: Umar 55330742+mu94-csl@users.noreply.github.com Co-authored-by: Mylo 36931363+gitmylo@users.noreply.github.com Co-authored-by: Markus Pobitzer markuspobitzer@gmail.com Co-authored-by: Cheng Lu lucheng.lc15@gmail.com Co-authored-by: Steven Liu 59462357+stevhliu@users.noreply.github.com Co-authored-by: Isamu Isozaki isamu.website@gmail.com Co-authored-by: Cesar Aybar csaybar@gmail.com Co-authored-by: Will Rice will@spokestack.io Co-authored-by: Adrià Arrufat 1671644+arrufat@users.noreply.github.com Co-authored-by: Sanchit Gandhi 93869735+sanchit-gandhi@users.noreply.github.com Co-authored-by: At-sushi dkahw210@kyoto.zaq.ne.jp Co-authored-by: Lucca Zenóbio luccazen@gmail.com Co-authored-by: Lysandre Debut lysandre@huggingface.co Co-authored-by: Isotr0py 41363108+Isotr0py@users.noreply.github.com Co-authored-by: pdoane pdoane2@gmail.com Co-authored-by: Will Berman wlbberman@gmail.com Co-authored-by: yiyixuxu <yixu310@gmail,com> Co-authored-by: Rupert Menneer 71332436+rupertmenneer@users.noreply.github.com Co-authored-by: sudowind wfpkueecs@163.com Co-authored-by: Takuma Mori takuma104@gmail.com Co-authored-by: Stas Bekman stas00@users.noreply.github.com Co-authored-by: Pedro Cuenca pedro@huggingface.co Co-authored-by: Laureηt laurentfainsin@protonmail.com Co-authored-by: Jongwoo Han jongwooo.han@gmail.com Co-authored-by: asfiyab-nvidia 117682710+asfiyab-nvidia@users.noreply.github.com Co-authored-by: clarencechen clarencechenct@gmail.com Co-authored-by: Laureηt laurent@fainsin.bzh Co-authored-by: superlabs-dev 133080491+superlabs-dev@users.noreply.github.com Co-authored-by: Dev Aggarwal devxpy@gmail.com Co-authored-by: Vimarsh Chaturvedi vimarsh.c@gmail.com Co-authored-by: 7eu7d7 31194890+7eu7d7@users.noreply.github.com Co-authored-by: cmdr2 shashank.shekhar.global@gmail.com Co-authored-by: wfng92 43742196+wfng92@users.noreply.github.com Co-authored-by: Glaceon-Hyy ffheyy0017@gmail.com Co-authored-by: yueyang.hyy yueyang.hyy@alibaba-inc.com

AmericanPresidentJimmyCarter pushed a commit to AmericanPresidentJimmyCarter/diffusers that referenced this pull request

Apr 26, 2024


Co-authored-by: Sayak Paul spsayakpaul@gmail.com

Looking at a longer ~16ep run, we see only good validation images after ~11ep:

https://wandb.ai/andsteing/controlnet_fill50k/runs/3j2hx6n8

Previously train_metrics[-1] was logged, resulting in very bumpy train metrics.

This makes only a very small difference (~1 min) with this model size, so removing the option introduced in cdb3cc.

Co-authored-by: Sayak Paul spsayakpaul@gmail.com


Co-authored-by: Sayak Paul spsayakpaul@gmail.com

Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Pedro Cuenca pedro@huggingface.co

Throw deprecation warning

Allow stable diffusion attend and excite pipeline to work with any size output image. Re: #2476, #2603

remvoe one line

add custom timesteps test

add custom timesteps descending order check

docs

timesteps -> custom_timesteps

can only pass one of num_inference_steps and timesteps

fix breaking change

Fix img2img processor with safety checker

Make sure correct timesteps are chosen for img2img

Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Pedro Cuenca pedro@huggingface.co

extract pipeline from log_validation

Adding act fn config to the unet timestep class embedding and conv activation.

The custom activation defaults to silu which is the default activation function for both the conv act and the timestep class embeddings so default behavior is not changed.

The only unet which use the custom activation is the stable diffusion latent upscaler https://huggingface.co/stabilityai/sd-x2-latent-upscaler/blob/main/unet/config.json (I ran a script against the hub to confirm). The latent upscaler does not use the conv activation nor the timestep class embeddings so we don't change its behavior.

This mimics the dtype cast for the standard time embeddings


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Signed-off-by: Asfiya Baig asfiyab@nvidia.com

Signed-off-by: Asfiya Baig asfiyab@nvidia.com

Signed-off-by: Asfiya Baig asfiyab@nvidia.com

  1. Update setting of cache directory
  2. Address comments: merge utils and pipeline code.
  3. Address comments: Add section in README

Signed-off-by: Asfiya Baig asfiyab@nvidia.com

Signed-off-by: Asfiya Baig asfiyab@nvidia.com


Signed-off-by: Asfiya Baig asfiyab@nvidia.com Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

⚙️chore(transformer_2d) update function signature for encoder_hidden_states


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: root fulong_ye@163.com

controlnet training center crop input images to multiple of 8

The pipeline code resizes inputs to multiples of 8. Not doing this resizing in the training script is causing the encoded image to have different height/width dimensions than the encoded conditioning image (which uses a separate encoder that's part of the controlnet model).

We resize and center crop the inputs to make sure they're the same size (as well as all other images in the batch). We also check that the initial resolution is a multiple of 8.


Co-authored-by: Nupur Kumari nupurkumari@Nupurs-MacBook-Pro.local Co-authored-by: Sayak Paul spsayakpaul@gmail.com Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com Co-authored-by: Nupur Kumari nupurkumari@nupurs-mbp.wifi.local.cmu.edu

Add missing newlines for rendering the links correctly

Signed-off-by: Ye, Xinyu xinyu.ye@intel.com

Signed-off-by: Ye, Xinyu xinyu.ye@intel.com

Signed-off-by: Ye, Xinyu xinyu.ye@intel.com

Signed-off-by: Ye, Xinyu xinyu.ye@intel.com

Signed-off-by: Ye, Xinyu xinyu.ye@intel.com


Signed-off-by: Ye, Xinyu xinyu.ye@intel.com

Fix inversion prompt broadcasting

deterministic algos

pass silence_dtype_warnings as kwarg

Signed-off-by: Asfiya Baig asfiyab@nvidia.com Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

fix from_flax

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Suraj Patil surajp815@gmail.com


Co-authored-by: Suraj Patil surajp815@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

fix bug

Revert "[Community Pipelines] Update lpw_stable_diffusion pipeline (#3197)"

This reverts commit 9965cb50eac12e397473f01535aab43aae76b4ab.

cast to weight dtype

adding enable_vae_tiling and disable_val_tiling functions

Add v1.1 docs

When the token used for textual inversion does not have any special symbols (e.g. it is not surrounded by <>), the tokenizer does not properly split the replacement tokens. Adding a space for the padding tokens fixes this.

sync cache version check from transformers


Co-authored-by: William Berman WLBberman@gmail.com


Co-authored-by: William Berman WLBberman@gmail.com

Write model card in controlnet training script.


Co-authored-by: njindal njindal@adobe.com

[Slow Test]: Cuda test fixes

Co-authored-by: njindal njindal@adobe.com

Remove required from tracker_project_name.

As observed by https://github.com/off99555 in https://github.com/huggingface/diffusers/issues/2695#issuecomment-1470755050, it already has a default value.


Co-authored-by: Sayak Paul spsayakpaul@gmail.com

Update repaint.mdx

accomodate to #1701

Co-authored-by: multimodalart joaopaulo.passos+multimodal@gmail.com

The pipeline is built as pipe but then used as pipeline.

Revert "Revert "[Community Pipelines] Update lpw_stable_diffusion pipeline" (#3201)"

This reverts commit 91a2a80eb2f98a9f64b9e287715add244dc6f2f3.

Co-authored-by: yiyixuxu yixu@yis-macbook-pro.lan

Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Pedro Cuenca pedro@huggingface.co

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Fix typos

This reverts commit b218062fed08d6cc164206d6cb852b2b7b00847a.

Add support for mask broadcasting

Update docs and tests

Align mask argument to mask_image

Remove height and width arguments

Suppress spurious warning by repeating image before latent to mask gen

add link to training script

Co-authored-by: yiyixuxu yixu@yis-macbook-pro.lan

The note-seq package throws an error on import because the default installed version of Ipython is not compatible with python 3.8 which we run in the CI. https://github.com/huggingface/diffusers/actions/runs/4830121056/jobs/8605954838#step:7:9

A pipeline object stores the results in images not in sample. Current code blocks don't work.

Co-authored-by: Sayak Paul spsayakpaul@gmail.com


Co-authored-by: yiyixuxu yixu@yis-macbook-pro.lan Co-authored-by: Sayak Paul spsayakpaul@gmail.com

Co-authored-by: Horace He horacehe2007@yahoo.com


Co-authored-by: Horace He horacehe2007@yahoo.com

fixed import statement

Fix missing variable assign

lol

Update build_documentation.yml

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

The argument upsample_size needs to be added to these modules to allow compatibility with other blocks that require this argument.

This reverts commit 10a174a12c82e6abd3d5a57665719a03dbb85ca7.

This reverts commit 1a58958ab4f024dbc4c90a6404c2e66210db6d00.

fix docstring

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

add fixed variance schedulers and lora loading

class prompts are now included in pre-encoding code max tokenizer length is now configurable embedding attention mask is now configurable


Co-authored-by: yiyixuxu <yixu310@gmail,com>

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Due to previous commit these tests were failing as height and width need to be passed into the prepare_mask_and_masked_image function, I have updated the code and added a height/width variable per unit test as it seemed more appropriate than the current hard coded solution

this unit test simply gets the input and resizes it into some that would fail (e.g. would throw a tensor mismatch error/not a mult of 8). Then passes it through the pipeline and verifies it produces output with correct dims w.r.t the passed height and width


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Fix typo in last code block. Correct "prommpts" to "prompt"

This reverts commit abe8d6311d4b7f5b9409ca709c7fabf80d06c1a9.

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

add transformers to install


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Add omegaconfg

Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Update pr_tests.yml

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Pedro Cuenca pedro@huggingface.co

Co-authored-by: Pedro pedro@huggingface.co


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com Co-authored-by: Pedro Cuenca pedro@huggingface.co

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Signed-off-by: Asfiya Baig asfiyab@nvidia.com

Signed-off-by: Asfiya Baig asfiyab@nvidia.com


Signed-off-by: Asfiya Baig asfiyab@nvidia.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Fix incomplete docstrings for resnet.py

fix tiled vae bleand extent range

Small update to "Next steps" section:

Allow arbitrary aspect ratio in IFSuperResolutionPipeline by using the input image shape


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

this is required when you aren't applying 100% noise to the masked region, e.g. strength < 1.

inspired from the stable diffusion img2img pipeline, init latents are initialised by converting the init image into a VAE latent and adding noise (based upon the strength parameter passed in), e.g. random when strength = 1, or the init image at strength = 0.

still need to add correct regression values

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

created a return_image boolean and initialised to false


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com Co-authored-by: William Berman WLBberman@gmail.com

Added bugfix using f strings.


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Release large tensors in attention (as soon as they're no longer required). Reduces peak VRAM by nearly 2 GB for 1024x1024 (even after slicing), and the savings scale up with image size.

add min snr to text2img lora training script


Co-authored-by: yueyang.hyy yueyang.hyy@alibaba-inc.com

Co-authored-by: Sayak Paul spsayakpaul@gmail.com

Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Sayak Paul spsayakpaul@gmail.com Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Sayak Paul spsayakpaul@gmail.com

explicit view kernel size as number elements in flattened indices

They are already a part of push_tests.yml.

They are already performed on push.

For better control/filtering.

This test passes in my Mac (Ventura 13.3) but fails in the CI hardware (Ventura 13.2). I ran the local tests following the same steps that exist in the CI workflow.

So we can test.

Tests passed, go back to running on push.

add note on local directory path.

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: StAlKeR7779 stalkek7779@yandex.ru


Co-authored-by: StAlKeR7779 stalkek7779@yandex.ru


Co-authored-by: Chanran Kim seriousran@gmail.com

Images may have rotations stored in EXIF. Training using such images will cause those transforms to be ignored while training and thus produce unexpected results

A pipeline object stores the results in images not in sample. Current code blocks don't work.

Co-authored-by: Sayak Paul spsayakpaul@gmail.com


Co-authored-by: yiyixuxu yixu@yis-macbook-pro.lan Co-authored-by: Sayak Paul spsayakpaul@gmail.com

Co-authored-by: Horace He horacehe2007@yahoo.com


Co-authored-by: Horace He horacehe2007@yahoo.com

fixed import statement

Fix missing variable assign

lol

Update build_documentation.yml

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

The argument upsample_size needs to be added to these modules to allow compatibility with other blocks that require this argument.

Due to how the option is named, it makes more sense to behave like this.

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Update README.md

Typo in docs

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Check for duplicate tokens

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

fix docstring

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

add fixed variance schedulers and lora loading

class prompts are now included in pre-encoding code max tokenizer length is now configurable embedding attention mask is now configurable


Co-authored-by: yiyixuxu <yixu310@gmail,com>

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Due to previous commit these tests were failing as height and width need to be passed into the prepare_mask_and_masked_image function, I have updated the code and added a height/width variable per unit test as it seemed more appropriate than the current hard coded solution

this unit test simply gets the input and resizes it into some that would fail (e.g. would throw a tensor mismatch error/not a mult of 8). Then passes it through the pipeline and verifies it produces output with correct dims w.r.t the passed height and width


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Fix typo in last code block. Correct "prommpts" to "prompt"

This reverts commit abe8d6311d4b7f5b9409ca709c7fabf80d06c1a9.

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

add transformers to install


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Add omegaconfg

Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Pedro Cuenca pedro@huggingface.co


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Update pr_tests.yml

Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com

Co-authored-by: Pedro Cuenca pedro@huggingface.co

Co-authored-by: Pedro pedro@huggingface.co


Co-authored-by: Patrick von Platen patrick.v.platen@gmail.com Co-authored-by: Pedro Cuenca pedro@huggingface.co

Co-authored-by: Patrick von Platen <patr…