* make scaling factor cnfig arg of vae
* fix
* make flake happy
* fix ldm
* fix upscaler
* qualirty
* Apply suggestions from code review
Co-authored-by: Anton Lozhkov <anton@huggingface.co>
Co-authored-by: Pedro Cuenca <pedro@huggingface.co>
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
* solve conflicts, addres some comments
* examples
* examples min version
* doc
* fix type
* typo
* Update src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_upscale.py
Co-authored-by: Pedro Cuenca <pedro@huggingface.co>
* remove duplicate line
* Apply suggestions from code review
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
Co-authored-by: Anton Lozhkov <anton@huggingface.co>
Co-authored-by: Pedro Cuenca <pedro@huggingface.co>
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
* Allow `UNet2DModel` to use arbitrary class embeddings.
We can currently use class conditioning in `UNet2DConditionModel`, but
not in `UNet2DModel`. However, `UNet2DConditionModel` requires text
conditioning too, which is unrelated to other types of conditioning.
This commit makes it possible for `UNet2DModel` to be conditioned on
entities other than timesteps. This is useful for training /
research purposes. We can currently train models to perform
unconditional image generation or text-to-image generation, but it's not
straightforward to train a model to perform class-conditioned image
generation, if text conditioning is not required.
We could potentiall use `UNet2DConditionModel` for class-conditioning
without text embeddings by using down/up blocks without
cross-conditioning. However:
- The mid block currently requires cross attention.
- We are required to provide `encoder_hidden_states` to `forward`.
* Style
* Align class conditioning, add docstring for `num_class_embeds`.
* Copy docstring to versatile_diffusion UNetFlatConditionModel
* make tests deterministic
* run slow tests
* prepare for testing
* finish
* refactor
* add print statements
* finish more
* correct some test failures
* more fixes
* set up to correct tests
* more corrections
* up
* fix more
* more prints
* add
* up
* up
* up
* uP
* uP
* more fixes
* uP
* up
* up
* up
* up
* fix more
* up
* up
* clean tests
* up
* up
* up
* more fixes
* Apply suggestions from code review
Co-authored-by: Suraj Patil <surajp815@gmail.com>
* make
* correct
* finish
* finish
Co-authored-by: Suraj Patil <surajp815@gmail.com>
* add text embeds to sd
* add text embeds to sd
* finish tests
* finish
* finish
* make style
* fix tests
* make style
* make style
* up
* better docs
* fix
* fix
* new try
* up
* up
* finish
* add: a doc on LoRA support in diffusers.
* Apply suggestions from code review
Co-authored-by: Pedro Cuenca <pedro@huggingface.co>
* apply PR suggestions.
* Apply suggestions from code review
Co-authored-by: Pedro Cuenca <pedro@huggingface.co>
* remove visually incoherent elements.
Co-authored-by: Pedro Cuenca <pedro@huggingface.co>
* allow passing op to xFormers attention
original code by @patil-suraj
huggingface/diffusers@ae0cc0b71f
* correct style by `make style`
* add attention_op arg documents
* add usage example to docstring
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
* add usage example to docstring
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
* code style correction by `make style`
* Update docstring code to a valid python example
Co-authored-by: Suraj Patil <surajp815@gmail.com>
* Update docstring code to a valid python example
Co-authored-by: Suraj Patil <surajp815@gmail.com>
* style correction by `make style`
* Update code exmaple to fully functional
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
Co-authored-by: Suraj Patil <surajp815@gmail.com>
* allow a local model directory to be used for merging
* moved checkpoint merge bugfix into main for testing
* possibly fix local variable "config_dict" referenced before assignment
* fix deprecation warning
* debugging...
* debugging
* allow safetensors
* safetensors try again
* fix syntax error
* further debugging
* fix logic error when checkpoint 2 is none
* more debugging...
* more debuging...
* more debugging...
* more debugging...
* debugging
* clean up status reporting
* skip the requires_safety_checker boolean
* moved checkpoint merge bugfix into main for testing
* possibly fix local variable "config_dict" referenced before assignment
* fix deprecation warning
* allow safetensors
* fix logic error when checkpoint 2 is none
* clean up status reporting
* undo hack to use private repo for community pipelines
* allow a local model directory to be used for merging
* allow safetensors
* clean up status reporting
* reformatted with black
* sort imported modules correctly
* Update examples/community/checkpoint_merger.py
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
* Update examples/community/checkpoint_merger.py
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
* Update examples/community/checkpoint_merger.py
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
* fix import style error
Co-authored-by: Lincoln Stein <lstein@gmail.com>
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
* Fix resuming state when using gradient checkpointing.
Also, allow --resume_from_checkpoint to be used when the checkpoint does
not yet exist (a normal training run will be started).
* style
* Dreambooth: use `optimizer.zero_grad(set_to_none=True)` to reduce VRAM usage
* Allow the user to control `optimizer.zero_grad(set_to_none=True)` with --set_grads_to_none
* Update Dreambooth readme
* Fix link in readme
* Fix header size in readme
* Safetensors loading in "convert_diffusers_to_original_stable_diffusion"
Adds diffusers format saftetensors loading support
* Fix import sort order: convert_diffusers_to_original_stable_diffusion.py
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
* example on fine-tuning with LoRA.
* apply make quality.
* fix: pipeline loading.
* Apply suggestions from code review
Co-authored-by: Suraj Patil <surajp815@gmail.com>
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
* apply suggestions for PR review.
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
* apply make style and make quality.
* chore: remove mention of dreambooth from text2image.
* add: weight path and wandb run link.
* Apply suggestions from code review
* apply make style.
* make style
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
Co-authored-by: Suraj Patil <surajp815@gmail.com>
* Correct Pix2Pix example
- no advertisement of revision -> it'll be deprecated soon
- by default safety checker should be used
* Update docs/source/en/api/pipelines/stable_diffusion/pix2pix.mdx
* up
* convert __main__ to a function call and call it
* add missing type hint
* make style check pass
* move loading to src/diffusers
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>