mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2026-11-14 12:56:33 +00:00
add wan2.1/2.2 FLF2V support
This commit is contained in:
1 parent
33ff442c1d
commit
e2a3a406b6
3 files changed
+44
-19
No files matched your search
@@ -71,7 +71,7 @@ struct SDParams {
|
||||
std::string output_path = "output.png";
|
||||
std::string init_image_path;
|
||||
std::string end_image_path;
|
||||
std::string mask_path;
|
||||
std::string mask_image_path;
|
||||
std::string control_image_path;
|
||||
std::vector<std::string> ref_image_paths;
|
||||
|
||||
@@ -146,7 +146,7 @@ void print_params(SDParams params) {
|
||||
printf(" output_path: %s\n", params.output_path.c_str());
|
||||
printf(" init_image_path: %s\n", params.init_image_path.c_str());
|
||||
printf(" end_image_path: %s\n", params.end_image_path.c_str());
|
||||
printf(" mask_image_path: %s\n", params.mask_path.c_str());
|
||||
printf(" mask_image_path: %s\n", params.mask_image_path.c_str());
|
||||
printf(" control_image_path: %s\n", params.control_image_path.c_str());
|
||||
printf(" ref_images_paths:\n");
|
||||
for (auto& path : params.ref_image_paths) {
|
||||
@@ -210,8 +210,9 @@ void print_usage(int argc, const char* argv[]) {
|
||||
printf(" If not specified, the default is the type of the weight file\n");
|
||||
printf(" --tensor-type-rules [EXPRESSION] weight type per tensor pattern (example: \"^vae\\.=f16,model\\.=q8_0\")\n");
|
||||
printf(" --lora-model-dir [DIR] lora model directory\n");
|
||||
printf(" -i, --init-img [IMAGE] path to the input image, required by img2img\n");
|
||||
printf(" -i, --init-img [IMAGE] path to the init image, required by img2img\n");
|
||||
printf(" --mask [MASK] path to the mask image, required by img2img with mask\n");
|
||||
printf(" -i, --end-img [IMAGE] path to the end image, required by flf2v\n");
|
||||
printf(" --control-image [IMAGE] path to image condition, control net\n");
|
||||
printf(" -r, --ref-image [PATH] reference image for Flux Kontext models (can be used multiple times) \n");
|
||||
printf(" -o, --output OUTPUT path to write result image to (default: ./output.png)\n");
|
||||
@@ -455,7 +456,7 @@ void parse_args(int argc, const char** argv, SDParams& params) {
|
||||
{"", "--end-img", "", ¶ms.end_image_path},
|
||||
{"", "--tensor-type-rules", "", ¶ms.tensor_type_rules},
|
||||
{"", "--input-id-images-dir", "", ¶ms.input_id_images_path},
|
||||
{"", "--mask", "", ¶ms.mask_path},
|
||||
{"", "--mask", "", ¶ms.mask_image_path},
|
||||
{"", "--control-image", "", ¶ms.control_image_path},
|
||||
{"-o", "--output", "", ¶ms.output_path},
|
||||
{"-p", "--prompt", "", ¶ms.prompt},
|
||||
@@ -1071,13 +1072,13 @@ int main(int argc, const char* argv[]) {
|
||||
}
|
||||
}
|
||||
|
||||
if (params.mask_path.size() > 0) {
|
||||
if (params.mask_image_path.size() > 0) {
|
||||
int c = 0;
|
||||
int width = 0;
|
||||
int height = 0;
|
||||
mask_image.data = load_image(params.mask_path.c_str(), width, height, params.width, params.height, 1);
|
||||
mask_image.data = load_image(params.mask_image_path.c_str(), width, height, params.width, params.height, 1);
|
||||
if (mask_image.data == NULL) {
|
||||
fprintf(stderr, "load image from '%s' failed\n", params.mask_path.c_str());
|
||||
fprintf(stderr, "load image from '%s' failed\n", params.mask_image_path.c_str());
|
||||
release_all_resources();
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user