qwen-image-interpolate

This commit is contained in:
Artiprocher
2025-08-19 10:50:56 +08:00
parent f11a91e610
commit 4abc2c1cd1
3 changed files with 244 additions and 0 deletions

View File

@@ -279,6 +279,7 @@ class QwenImagePipeline(BasePipeline):
tile_stride: int = 64,
# Progress bar
progress_bar_cmd = tqdm,
extra_prompt_emb = None,
):
# Scheduler
self.scheduler.set_timesteps(num_inference_steps, denoising_strength=denoising_strength, dynamic_shift_len=(height // 16) * (width // 16))
@@ -304,6 +305,9 @@ class QwenImagePipeline(BasePipeline):
}
for unit in self.units:
inputs_shared, inputs_posi, inputs_nega = self.unit_runner(unit, self, inputs_shared, inputs_posi, inputs_nega)
if extra_prompt_emb is not None:
inputs_posi["prompt_emb"] = torch.concat([inputs_posi["prompt_emb"], extra_prompt_emb], dim=1)
inputs_posi["prompt_emb_mask"] = torch.ones((1, inputs_posi["prompt_emb"].shape[1]), dtype=inputs_posi["prompt_emb_mask"].dtype, device=inputs_posi["prompt_emb_mask"].device)
# Denoise
self.load_models_to_device(self.in_iteration_models)