Skip to content

Commit 5498cc0

Browse files
authored
feat: add Wan2.1-I2V-1.3B(SkyReels) support (#988)
1 parent aa2b8e0 commit 5498cc0

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

stable-diffusion.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,9 @@ class StableDiffusionGGML {
456456
"model.high_noise_diffusion_model",
457457
version);
458458
}
459-
if (diffusion_model->get_desc() == "Wan2.1-I2V-14B" || diffusion_model->get_desc() == "Wan2.1-FLF2V-14B") {
459+
if (diffusion_model->get_desc() == "Wan2.1-I2V-14B" ||
460+
diffusion_model->get_desc() == "Wan2.1-FLF2V-14B" ||
461+
diffusion_model->get_desc() == "Wan2.1-I2V-1.3B") {
460462
clip_vision = std::make_shared<FrozenCLIPVisionEmbedder>(backend,
461463
offload_params_to_cpu,
462464
tensor_storage_map);
@@ -3399,10 +3401,12 @@ SD_API sd_image_t* generate_video(sd_ctx_t* sd_ctx, const sd_vid_gen_params_t* s
33993401
int64_t ref_image_num = 0; // for vace
34003402
if (sd_ctx->sd->diffusion_model->get_desc() == "Wan2.1-I2V-14B" ||
34013403
sd_ctx->sd->diffusion_model->get_desc() == "Wan2.2-I2V-14B" ||
3404+
sd_ctx->sd->diffusion_model->get_desc() == "Wan2.1-I2V-1.3B" ||
34023405
sd_ctx->sd->diffusion_model->get_desc() == "Wan2.1-FLF2V-14B") {
34033406
LOG_INFO("IMG2VID");
34043407

34053408
if (sd_ctx->sd->diffusion_model->get_desc() == "Wan2.1-I2V-14B" ||
3409+
sd_ctx->sd->diffusion_model->get_desc() == "Wan2.1-I2V-1.3B" ||
34063410
sd_ctx->sd->diffusion_model->get_desc() == "Wan2.1-FLF2V-14B") {
34073411
if (sd_vid_gen_params->init_image.data) {
34083412
clip_vision_output = sd_ctx->sd->get_clip_vision_output(work_ctx, sd_vid_gen_params->init_image, false, -2);

wan.hpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2075,15 +2075,19 @@ namespace WAN {
20752075
wan_params.text_len = 512;
20762076
} else {
20772077
if (wan_params.vace_layers > 0) {
2078-
desc = "Wan2.1-VACE-1.3B";
2078+
desc = "Wan2.1-VACE-1.3B";
2079+
wan_params.in_dim = 16;
2080+
} else if (wan_params.model_type == "i2v") {
2081+
desc = "Wan2.1-I2V-1.3B";
2082+
wan_params.in_dim = 36;
20792083
} else {
2080-
desc = "Wan2.1-T2V-1.3B";
2084+
desc = "Wan2.1-T2V-1.3B";
2085+
wan_params.in_dim = 16;
20812086
}
20822087
wan_params.dim = 1536;
20832088
wan_params.eps = 1e-06;
20842089
wan_params.ffn_dim = 8960;
20852090
wan_params.freq_dim = 256;
2086-
wan_params.in_dim = 16;
20872091
wan_params.num_heads = 12;
20882092
wan_params.out_dim = 16;
20892093
wan_params.text_len = 512;

0 commit comments

Comments
 (0)