Skip to content
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

[Pipeline] Add LEDITS++ pipelines #6074

Merged
merged 56 commits into from
Mar 13, 2024
Merged
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
eb9d25b
Setup LEdits++ file structure
manuelbrack Nov 30, 2023
b53ecc1
Fix import
manuelbrack Nov 30, 2023
92eb6b3
LEditsPP Stable Diffusion pipeline
kathath Nov 30, 2023
c86cd2b
Include variable image aspect ratios
manuelbrack Nov 30, 2023
cf89827
Implement LEDITS++ for SDXL
manuelbrack Dec 1, 2023
2111db0
clean up LEditsPPPipelineStableDiffusion
kathath Dec 1, 2023
03b5770
Merge branch 'ledits_pp' of github.com:ml-research/diffusers into led…
kathath Dec 1, 2023
a0deef0
Adjust inversion output
manuelbrack Dec 1, 2023
32a78ef
Added docu, more cleanup for LEditsPPPipelineStableDiffusion
kathath Dec 5, 2023
4b2e3be
Merge branch 'ledits_pp' of github.com:ml-research/diffusers into led…
kathath Dec 5, 2023
e9aec54
clean up LEditsPPPipelineStableDiffusionXL
kathath Dec 6, 2023
1ef50b3
Update documentation
manuelbrack Dec 7, 2023
a00b353
Fix documentation import
manuelbrack Dec 7, 2023
ce70506
Add skeleton IF implementation
manuelbrack Dec 7, 2023
127c352
Fix documentation typo
manuelbrack Dec 7, 2023
c90c80e
Add LEDTIS docu to toctree
manuelbrack Dec 7, 2023
af19de6
Add missing title
manuelbrack Dec 7, 2023
06e8861
Finalize SD documentation
manuelbrack Dec 7, 2023
149bc4d
Finalize SD-XL documentation
manuelbrack Dec 7, 2023
d798e05
Fix code style and quality
manuelbrack Dec 7, 2023
e1f428b
Fix typo
manuelbrack Dec 7, 2023
c2d7a0a
Fix return types
manuelbrack Dec 8, 2023
244e6f0
added LEditsPPPipelineIF; minor changes for LEditsPPPipelineStableDif…
kathath Dec 8, 2023
0da0115
Fix copy reference
manuelbrack Dec 10, 2023
69f064f
add documentation for IF
manuelbrack Dec 10, 2023
d690ad8
Add first tests
kathath Dec 12, 2023
82a2d5a
Fix batching for SD-XL
kathath Dec 20, 2023
1464328
Fix text encoding and perfect reconstruction for SD-XL
kathath Dec 20, 2023
f6b94eb
Add tests for SD-XL, minor changes
kathath Dec 20, 2023
8409e04
move user_mask to correct device, use cross_attention_kwargs also for…
kathath Dec 28, 2023
49a4a2c
Example docstring
kathath Dec 28, 2023
b5055b8
Fix attention resolution for non-square images
manuelbrack Jan 25, 2024
2e06d07
Refactoring for PR review
manuelbrack Jan 29, 2024
935508d
Merge branch 'main' into ledits_pp
manuelbrack Jan 29, 2024
8154fee
Safely remove ledits_utils.py
manuelbrack Jan 29, 2024
074a035
Style fixes
manuelbrack Jan 29, 2024
0d60c3b
Replace assertions with ValueError
manuelbrack Jan 29, 2024
2da7bca
Remove LEditsPPPipelineIF
manuelbrack Feb 8, 2024
87b2f08
Remove unecessary input checks
manuelbrack Feb 8, 2024
e91ef78
Refactoring of CrossAttnProcessor
manuelbrack Feb 9, 2024
0ab4ec0
Revert unecessary changes to scheduler
manuelbrack Feb 9, 2024
ae13535
Remove first progress-bar in inversion
manuelbrack Feb 9, 2024
2dc5247
Refactor scheduler usage and reset
manuelbrack Feb 13, 2024
8e5e310
Use imageprocessor instead of custom logic
manuelbrack Feb 13, 2024
1ec846a
Fix scheduler init warning
manuelbrack Feb 13, 2024
9de246b
Fix error when running the pipeline in fp16
manuelbrack Feb 13, 2024
e71c5ce
Update documentation wrt perfect inversion
manuelbrack Feb 13, 2024
76b4447
Update tests
manuelbrack Feb 13, 2024
74627c8
Merge branch 'huggingface:main' into ledits_pp
manuelbrack Feb 27, 2024
976edb6
Fix code quality and copy consistency
manuelbrack Feb 27, 2024
73574a5
Update LEditsPP import
manuelbrack Mar 1, 2024
afab27d
Merge branch 'main' into ledits_pp
manuelbrack Mar 1, 2024
47f64fd
Remove enable/disable methods that are now in StableDiffusionMixin
manuelbrack Mar 6, 2024
6770e67
Change import in docs
manuelbrack Mar 7, 2024
8ba5e24
Revert import structure change
manuelbrack Mar 7, 2024
dfa291f
Fix ledits imports
manuelbrack Mar 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Example docstring
kathath committed Dec 28, 2023
commit 49a4a2c0fbd8c7b806e4effc06d294111991150f
49 changes: 42 additions & 7 deletions src/diffusers/pipelines/ledits_pp/pipeline_leditspp_if.py
Original file line number Diff line number Diff line change
@@ -39,13 +39,48 @@

EXAMPLE_DOC_STRING = """
Examples:
```py
>>> import PIL
>>> import requests
>>> import torch
>>> from io import BytesIO
TODO
```
```py
>>> import PIL
>>> import requests
>>> import torch
>>> from io import BytesIO

>>> from diffusers import LEditsPPPipelineIF, IFSuperResolutionPipeline

>>> pipe = LEditsPPPipelineIF.from_pretrained(
... "DeepFloyd/IF-I-XL-v1.0"
... )
>>> pipe.enable_model_cpu_offload()

>>> def download_image(url):
... response = requests.get(url)
... return PIL.Image.open(BytesIO(response.content)).convert("RGB")

>>> img_url = "https://www.aiml.informatik.tu-darmstadt.de/people/mbrack/tennis.jpg"
>>> image = download_image(img_url)

>>> _ = pipe.invert(
... image = image,
... num_inversion_steps=50,
... skip=0.3
... )

>>> edited_image = pipe(
... editing_prompt=["tennis ball","tomato"],
... reverse_editing_direction=[True,False],
... edit_guidance_scale=[5.0,10.0],
... edit_threshold=[0.9,0.85],
).images[0]

>>> super_res_1_pipe = IFSuperResolutionPipeline.from_pretrained(
... "DeepFloyd/IF-II-L-v1.0"
... )
>>> super_res_1_pipe.enable_model_cpu_offload()

>>> image = super_res_1_pipe(
... image=edited_image, prompt="", noise_level=0
... ).images[0]
```
"""