-
Notifications
You must be signed in to change notification settings - Fork 6.6k
support sd3.5 for controlnet example #9860
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
Merged
Merged
Changes from 8 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
016367d
support sd3.5 in controlnet
DavyMorgan 41664d6
fix train controlnet sd3 from transformer
DavyMorgan f35a31e
add test script for training controlnet sd3.5
DavyMorgan b9b7028
fix controlnet
DavyMorgan 6ac4251
add sd3.5 to readme
DavyMorgan fb1ae0c
add preprocessing batchsize
DavyMorgan dbd60e3
update readme
DavyMorgan 9765601
pass make quality
DavyMorgan 4f8b3b0
update test
DavyMorgan 88eb200
Merge branch 'main' into sd3.5-controlnet
DavyMorgan c0f1a87
fix sd3.5
DavyMorgan df9712b
add extra conditioning channels to cli, use hf-internal-testing host
DavyMorgan 5c2709a
Merge branch 'main' into sd3.5-controlnet
DavyMorgan 3220b71
Merge branch 'main' into sd3.5-controlnet
yiyixuxu 13c8d13
rebase
DavyMorgan f143065
rebase
DavyMorgan 3a06a97
quality
DavyMorgan b135b97
Merge branch 'huggingface:main' into sd3.5-controlnet
DavyMorgan 0ac2192
fix typo
DavyMorgan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -11,8 +11,7 @@ | |
| # 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. | ||
|
|
||
|
|
||
| import math | ||
| from typing import Any, Dict, List, Optional, Tuple, Union | ||
|
|
||
| import torch | ||
|
|
@@ -344,7 +343,7 @@ def custom_forward(*inputs): | |
|
|
||
| # controlnet residual | ||
| if block_controlnet_hidden_states is not None and block.context_pre_only is False: | ||
| interval_control = len(self.transformer_blocks) // len(block_controlnet_hidden_states) | ||
| interval_control = int(math.ceil(len(self.transformer_blocks) / len(block_controlnet_hidden_states))) | ||
|
||
| hidden_states = hidden_states + block_controlnet_hidden_states[index_block // interval_control] | ||
|
|
||
| hidden_states = self.norm_out(hidden_states, temb) | ||
|
|
||
This file contains hidden or 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.
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.
Should this be hard-coded like this? Can we use a CLI arg?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I have added a CLI arg.