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
[WIP] Add Fabric #4201
Merged
Merged
[WIP] Add Fabric #4201
Changes from 95 commits
Commits
Show all changes
104 commits
Select commit
Hold shift + click to select a range
8e871c6
empty PR
shauray8 fbc3af9
init
shauray8 2c8a021
changes
shauray8 ccfc546
starting with the pipeline
shauray8 c815605
stable diff
shauray8 b65184b
prev
shauray8 1c4833c
more things, getting started
shauray8 c9eb420
more functions
shauray8 7bec286
makeing it more readable
shauray8 adebe8f
almost done testing
shauray8 a31699f
var changes
shauray8 b94cbf4
testing
shauray8 2999f40
device
shauray8 834ab80
device support
shauray8 39ea4f9
maybe
shauray8 fb59e24
device malfunctions
shauray8 1ac8004
new new
shauray8 4b3f1a6
register
shauray8 ad988f2
testing
shauray8 a1cf609
exec does not work
shauray8 27bb344
float
shauray8 b827bf3
change info
shauray8 4aa7aaa
change of architecture
shauray8 6e7ab4e
might work
shauray8 f9635d7
testing with colab
shauray8 cda85ed
more attn atuff
shauray8 9eb6459
stupid additions
shauray8 ef34c1a
documenting and testing
shauray8 f0efafa
writing tests
shauray8 88a5a9a
more docs
shauray8 9fa434f
tests and docs
shauray8 e3fc7ca
remove test
shauray8 af17f11
Merge branch 'main' into FABRIC
shauray8 d78fb6b
empty PR
shauray8 2fc9642
init
shauray8 fb525bf
changes
shauray8 2e6b75b
starting with the pipeline
shauray8 caa4bfe
stable diff
shauray8 87665a8
prev
shauray8 4f706a8
more things, getting started
shauray8 697a0b0
more functions
shauray8 bddf128
makeing it more readable
shauray8 5ab690f
almost done testing
shauray8 4f8bc73
var changes
shauray8 8476267
testing
shauray8 90e395b
device
shauray8 32a28b3
device support
shauray8 12f2772
maybe
shauray8 cf18db8
device malfunctions
shauray8 2480245
new new
shauray8 be6ddf3
register
shauray8 0463bd6
testing
shauray8 5b09784
exec does not work
shauray8 413d450
float
shauray8 e44e8ce
change info
shauray8 3e4965a
change of architecture
shauray8 1ab807d
might work
shauray8 f603f65
testing with colab
shauray8 99ab1bf
more attn atuff
shauray8 9f9810e
stupid additions
shauray8 4ea0d50
documenting and testing
shauray8 ed90191
writing tests
shauray8 7513416
more docs
shauray8 3a7a783
tests and docs
shauray8 897f067
remove test
shauray8 60de01f
Merge branch 'FABRIC' of https://github.com/shauray8/diffusers into F…
shauray8 3bc14e3
change cross attention
shauray8 dd6e9b2
revert back
shauray8 60e37a0
tests
shauray8 a9e5e4c
Merge branch 'main' into FABRIC
shauray8 ea2ada8
reverting back to orig
shauray8 994ba48
changes
shauray8 0025a20
test passing
shauray8 04697a0
pipeline changes
shauray8 79be7ff
before quality
shauray8 ba8aa35
quality checks pass
shauray8 77d97f7
Merge branch 'main' into FABRIC
shauray8 9d1297d
remove print statements
shauray8 c7b3522
doc fixes
shauray8 a166b55
__init__ error something
shauray8 6261e9d
update docs, working on dim
shauray8 913c69a
working on encoding
shauray8 83f744b
doc fix
shauray8 bda8c53
more fixes
shauray8 ffe80d0
no more dependent on 512*512
shauray8 4a1859a
update docs
shauray8 34ea6df
fixes
shauray8 2fe64ff
test passing
shauray8 ac517d3
remove comment
shauray8 882f1a1
fixes and migration
shauray8 b87efcc
simpler tests
shauray8 3304440
doc changes
shauray8 4a2b84a
green CI
shauray8 b9002ee
changes
shauray8 a75c412
more docs
shauray8 40df49a
changes
shauray8 8c3516b
new images
shauray8 8ac96a2
Merge branch 'main' into FABRIC
sayakpaul 3a34767
to community examples
shauray8 4029b48
selete
shauray8 f747ef1
merge fixes
shauray8 40c0971
more fixes
shauray8 f05beca
changes
shauray8 aa96ed5
fix
shauray8 File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<!--Copyright 2023 The HuggingFace Team. All rights reserved. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
the License. You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations under the License. | ||
--> | ||
|
||
# FABRIC | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we maybe also add this to the README.md in |
||
|
||
[FABRIC: Personalizing Diffusion Models with Iterative Feedback](https://huggingface.co/papers/2307.10159) (FABRIC) is by Dimitri von Rütte, Elisabetta Fedele, Jonathan Thomm and Lukas Wolf. | ||
|
||
FABRIC is a training-free approach that conditions the diffusion process on a set of feedback images, applicable to a wide range of popular diffusion models. It is created by researchers and engineers from [ETH Zürich, Switzerland](https://github.com/sd-fabric). The [`FabricPipeline`] can generate photo-realistic images given any text input using Stable Diffusion. | ||
|
||
The abstract from the paper is: | ||
|
||
*In an era where visual content generation is increasingly driven by machine learning, the integration of human feedback into generative models presents significant opportunities for enhancing user experience and output quality. This study explores strategies for incorporating iterative human feedback into the generative process of diffusion-based text-to-image models. We propose FABRIC, a training-free approach applicable to a wide range of popular diffusion models, which exploits the self-attention layer present in the most widely used architectures to condition the diffusion process on a set of feedback images. To ensure a rigorous assessment of our approach, we introduce a comprehensive evaluation methodology, offering a robust mechanism to quantify the performance of generative visual models that integrate human feedback. We show that generation results improve over multiple rounds of iterative feedback through exhaustive analysis, implicitly optimizing arbitrary user preferences. The potential applications of these findings extend to fields such as personalized content creation and customization* | ||
|
||
The original codebase can be found at [sd-fabric/fabric](https://github.com/sd-fabric/fabric), and available checkpoints are [dreamlike-art/dreamlike-photoreal-2.0](https://huggingface.co/dreamlike-art/dreamlike-photoreal-2.0), [runwayml/stable-diffusion-v1-5](https://huggingface.co/runwayml/stable-diffusion-v1-5), and [stabilityai/stable-diffusion-2-1](https://huggingface.co/stabilityai/stable-diffusion-2-1) (may give unexpected results). | ||
|
||
Let's have a look at the images (*512X512*) | ||
|
||
| Without Feedback | With Feedback (1st image) | | ||
|---------------------|---------------------| | ||
| ![Image 1](https://drive.google.com/uc?export=view&id=12wxbikt7834eRTK40legR5PtJmFLNH34) | ![Feedback Image 1](https://drive.google.com/uc?export=view&id=1YcFPDHSRr2OE3hy-5lvr8An21Jum85D5) | | ||
shauray8 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
shauray8 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<Tip> | ||
|
||
Make sure to check out the Stable Diffusion [Tips](overview#tips) section to learn how to explore the tradeoff between scheduler speed and quality, and how to reuse pipeline components efficiently! | ||
|
||
</Tip> | ||
|
||
shauray8 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
[[autodoc]] FabricPipeline | ||
- all | ||
- __call__ | ||
shauray8 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## StableDiffusionPipelineOutput | ||
|
||
[[autodoc]] pipelines.stable_diffusion.StableDiffusionPipelineOutput |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.