-
Couldn't load subscription status.
- Fork 6.5k
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
Changes from 11 commits
016367d
41664d6
f35a31e
b9b7028
6ac4251
fb1ae0c
dbd60e3
9765601
4f8b3b0
88eb200
c0f1a87
df9712b
5c2709a
3220b71
13c8d13
f143065
3a06a97
b135b97
0ac2192
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -55,6 +55,10 @@ def __init__( | |||
| pooled_projection_dim: int = 2048, | ||||
| out_channels: int = 16, | ||||
| pos_embed_max_size: int = 96, | ||||
| dual_attention_layers: Tuple[ | ||||
|
||||
| dual_attention_layers: Tuple[int, ...] = (), |
can you rebase?
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.
yeah sure
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.
@yiyixuxu done.
| 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) | ||
|
|
||
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.