Skip to content

Commit a503401

Browse files
authored
fix(ernie-image): avoid locals() comprehension scope issue in callback kwargs (#13478)
1 parent 3a7ecb1 commit a503401

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/diffusers/pipelines/ernie_image/pipeline_ernie_image.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,9 @@ def __call__(
352352

353353
# Callback
354354
if callback_on_step_end is not None:
355-
callback_kwargs = {k: locals()[k] for k in callback_on_step_end_tensor_inputs}
355+
callback_kwargs = {}
356+
for k in callback_on_step_end_tensor_inputs:
357+
callback_kwargs[k] = locals()[k]
356358
callback_outputs = callback_on_step_end(self, i, t, callback_kwargs)
357359
latents = callback_outputs.pop("latents", latents)
358360

0 commit comments

Comments
 (0)