fix: add alpha channel input for Qwen Image 2.1 and relative docs (#2021)

This commit is contained in:
Weiqi Gao
2026-09-22 21:45:06 +08:00
committed by GitHub
parent e01206574b
commit e112ab5a50
12 changed files with 125 additions and 50 deletions
+12 -4
View File
@@ -470,11 +470,15 @@ namespace sd::pipeline {
sd::Tensor<float> end_image;
if (sd_vid_gen_params->init_image.data) {
start_image = sd_image_to_tensor(sd_vid_gen_params->init_image, request->width, request->height);
start_image = ensure_image_tensor_channels(
sd_image_to_tensor(sd_vid_gen_params->init_image, request->width, request->height),
sd->get_image_channels());
}
if (sd_vid_gen_params->end_image.data) {
end_image = sd_image_to_tensor(sd_vid_gen_params->end_image, request->width, request->height);
end_image = ensure_image_tensor_channels(
sd_image_to_tensor(sd_vid_gen_params->end_image, request->width, request->height),
sd->get_image_channels());
}
if (sd_version_is_minimax_h3(sd->version)) {
@@ -1416,7 +1420,9 @@ namespace sd::pipeline {
sd::Tensor<float> video_mask = make_ltxav_video_denoise_mask(video_latent, 1.f);
if (sd_vid_gen_params->init_image.data != nullptr) {
sd::Tensor<float> start_image = sd_image_to_tensor(sd_vid_gen_params->init_image, image_width, image_height);
sd::Tensor<float> start_image = ensure_image_tensor_channels(
sd_image_to_tensor(sd_vid_gen_params->init_image, image_width, image_height),
sd->get_image_channels());
if (!apply_ltxav_condition_image_by_latent_index(sd,
start_image,
&video_latent,
@@ -1429,7 +1435,9 @@ namespace sd::pipeline {
}
if (sd_vid_gen_params->end_image.data != nullptr) {
sd::Tensor<float> end_image = sd_image_to_tensor(sd_vid_gen_params->end_image, image_width, image_height);
sd::Tensor<float> end_image = ensure_image_tensor_channels(
sd_image_to_tensor(sd_vid_gen_params->end_image, image_width, image_height),
sd->get_image_channels());
sd::Tensor<float> end_image_latent = encode_ltxav_condition_image(sd, end_image, "end");
if (end_image_latent.empty()) {
return false;