Skip to content
GitLab
菜单
为什么选择 GitLab
定价
联系销售
探索
为什么选择 GitLab
定价
联系销售
探索
登录
获取免费试用
主导航
搜索或转到…
项目
C
ComfyUI
管理
动态
成员
代码
仓库
分支
提交
标签
仓库图
比较修订版本
锁定的文件
部署
模型注册表
分析
模型实验
帮助
帮助
支持
GitLab 文档
比较 GitLab 各版本
社区论坛
为极狐GitLab 提交贡献
提交反馈
隐私声明
快捷键
?
新增功能
4
代码片段
群组
项目
Show more breadcrumbs
hanamizuki
ComfyUI
提交
41886af1
提交
41886af1
编辑于
3个月前
作者:
comfyanonymous
浏览文件
操作
下载
补丁
差异文件
Add transformer options blocks replace patch to mochi.
上级
22a1d7ce
No related branches found
No related tags found
无相关合并请求
变更
1
隐藏空白变更内容
行内
左右并排
显示
1 个更改的文件
comfy/ldm/genmo/joint_model/asymm_models_joint.py
+27
-9
27 个添加, 9 个删除
comfy/ldm/genmo/joint_model/asymm_models_joint.py
有
27 个添加
和
9 个删除
comfy/ldm/genmo/joint_model/asymm_models_joint.py
+
27
−
9
浏览文件 @
41886af1
...
...
@@ -494,8 +494,9 @@ class AsymmDiTJoint(nn.Module):
packed_indices
:
Dict
[
str
,
torch
.
Tensor
]
=
None
,
rope_cos
:
torch
.
Tensor
=
None
,
rope_sin
:
torch
.
Tensor
=
None
,
control
=
None
,
**
kwargs
control
=
None
,
transformer_options
=
{},
**
kwargs
):
patches_replace
=
transformer_options
.
get
(
"
patches_replace
"
,
{})
y_feat
=
context
y_mask
=
attention_mask
sigma
=
timestep
...
...
@@ -515,15 +516,32 @@ class AsymmDiTJoint(nn.Module):
)
del
y_mask
blocks_replace
=
patches_replace
.
get
(
"
dit
"
,
{})
for
i
,
block
in
enumerate
(
self
.
blocks
):
x
,
y_feat
=
block
(
x
,
c
,
y_feat
,
rope_cos
=
rope_cos
,
rope_sin
=
rope_sin
,
crop_y
=
num_tokens
,
)
# (B, M, D), (B, L, D)
if
(
"
double_block
"
,
i
)
in
blocks_replace
:
def
block_wrap
(
args
):
out
=
{}
out
[
"
img
"
],
out
[
"
txt
"
]
=
block
(
args
[
"
img
"
],
args
[
"
vec
"
],
args
[
"
txt
"
],
rope_cos
=
args
[
"
rope_cos
"
],
rope_sin
=
args
[
"
rope_sin
"
],
crop_y
=
args
[
"
num_tokens
"
]
)
return
out
out
=
blocks_replace
[(
"
double_block
"
,
i
)]({
"
img
"
:
x
,
"
txt
"
:
y_feat
,
"
vec
"
:
c
,
"
rope_cos
"
:
rope_cos
,
"
rope_sin
"
:
rope_sin
,
"
num_tokens
"
:
num_tokens
},
{
"
original_block
"
:
block_wrap
})
y_feat
=
out
[
"
txt
"
]
x
=
out
[
"
img
"
]
else
:
x
,
y_feat
=
block
(
x
,
c
,
y_feat
,
rope_cos
=
rope_cos
,
rope_sin
=
rope_sin
,
crop_y
=
num_tokens
,
)
# (B, M, D), (B, L, D)
del
y_feat
# Final layers don't use dense text features.
x
=
self
.
final_layer
(
x
,
c
)
# (B, M, patch_size ** 2 * out_channels)
...
...
This diff is collapsed.
点击以展开。
预览
0%
加载中
请重试
或
添加新附件
.
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
保存评论
取消
想要评论请
注册
或
登录