Skip to content

Commit 83d0471

Browse files
Support HiDream E1 model. (Comfy-Org#7857)
1 parent 7d32977 commit 83d0471

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

comfy/ldm/hidream/model.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,10 +699,13 @@ def forward(
699699
y: Optional[torch.Tensor] = None,
700700
context: Optional[torch.Tensor] = None,
701701
encoder_hidden_states_llama3=None,
702+
image_cond=None,
702703
control = None,
703704
transformer_options = {},
704705
) -> torch.Tensor:
705706
bs, c, h, w = x.shape
707+
if image_cond is not None:
708+
x = torch.cat([x, image_cond], dim=-1)
706709
hidden_states = comfy.ldm.common_dit.pad_to_patch_size(x, (self.patch_size, self.patch_size))
707710
timesteps = t
708711
pooled_embeds = y

comfy/model_base.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,4 +1104,7 @@ def extra_conds(self, **kwargs):
11041104
conditioning_llama3 = kwargs.get("conditioning_llama3", None)
11051105
if conditioning_llama3 is not None:
11061106
out['encoder_hidden_states_llama3'] = comfy.conds.CONDRegular(conditioning_llama3)
1107+
image_cond = kwargs.get("concat_latent_image", None)
1108+
if image_cond is not None:
1109+
out['image_cond'] = comfy.conds.CONDNoiseShape(self.process_latent_in(image_cond))
11071110
return out

0 commit comments

Comments
 (0)