Skip to content

Commit

Permalink
pipeline done
Browse files Browse the repository at this point in the history
  • Loading branch information
JingyaHuang committed Aug 21, 2024
1 parent 61a9fad commit c32583e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions optimum/neuron/pipelines/diffusers/pipeline_controlnet_sd_xl.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,14 @@ def __call__(
controlnet_cond_scale = controlnet_cond_scale[0]
cond_scale = controlnet_cond_scale * controlnet_keep[i]

# Duplicate inputs for ddp
t = torch.tensor([t] * 2) if self.data_parallel_mode == "unet" else t
cond_scale = (
torch.tensor([cond_scale]).repeat(2)
if self.data_parallel_mode == "unet"
else torch.tensor(cond_scale)
)

down_block_res_samples, mid_block_res_sample = self.controlnet(
control_model_input,
t,
Expand Down Expand Up @@ -680,8 +688,6 @@ def __call__(
mid_block_additional_residual=mid_block_res_sample,
added_cond_kwargs=added_cond_kwargs,
)[0]
import pdb
pdb.set_trace()

# perform guidance
if do_classifier_free_guidance:
Expand Down

0 comments on commit c32583e

Please sign in to comment.