Skip to content

Commit 21543de

Browse files
authored
remove syncs before denoising in Kontext (#11818)
1 parent d7dd924 commit 21543de

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/diffusers/pipelines/flux/pipeline_flux.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,8 @@ def __call__(
898898
)
899899

900900
# 6. Denoising loop
901+
# We set the index here to remove DtoH sync, helpful especially during compilation.
902+
# Check out more details here: https://github.com/huggingface/diffusers/pull/11696
901903
self.scheduler.set_begin_index(0)
902904
with self.progress_bar(total=num_inference_steps) as progress_bar:
903905
for i, t in enumerate(timesteps):

src/diffusers/pipelines/flux/pipeline_flux_kontext.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,6 +1043,9 @@ def __call__(
10431043
)
10441044

10451045
# 6. Denoising loop
1046+
# We set the index here to remove DtoH sync, helpful especially during compilation.
1047+
# Check out more details here: https://github.com/huggingface/diffusers/pull/11696
1048+
self.scheduler.set_begin_index(0)
10461049
with self.progress_bar(total=num_inference_steps) as progress_bar:
10471050
for i, t in enumerate(timesteps):
10481051
if self.interrupt:

0 commit comments

Comments
 (0)