Solve KeyError: 'pixel_values' in Qwen-Image-Edit-2509 when number of control images is less than 3 #461
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes #441: Standardize control image handling for training pipeline
This commit refactors the way control images are processed and passed to the model to ensure consistency and robustness.
In
extensions_built_in/diffusion_models/qwen_image/qwen_image_edit_plus.py:_prepare_control_images_for_prompt, has been added at line 158.[tensor_ctrl0, ...]).get_prompt_embeds, where each image is then interpolated, has its extra batch dimension squeezed, and is passed to the Qwen pipeline as a CPU float32 tensor.In
extensions_built_in/sd_trainer/SDTrainer.py:batch.control_tensor_list.batch.control_tensorinto a list. This ensures control images are always passed to the model during training.