paint: use iris for neural nodes
This commit is contained in:
@@ -7,37 +7,11 @@ bool inpaint_image_node_tiled;
|
||||
static string_array_t *inpaint_image_node_flux_klein_args(char *dir) {
|
||||
string_array_t *argv = any_array_create_from_raw(
|
||||
(void *[]){
|
||||
string("%s/%s", dir, neural_node_sd_bin()),
|
||||
"--diffusion-model",
|
||||
string("%s/flux-2-klein-4b-Q8_0.gguf", dir),
|
||||
"--taesd",
|
||||
string("%s/taef2.safetensors", dir),
|
||||
"--llm",
|
||||
string("%s/Qwen3-4B-Q8_0.gguf", dir),
|
||||
"--steps",
|
||||
"4",
|
||||
string("%s/%s", dir, neural_node_iris_bin()),
|
||||
"-d",
|
||||
string("%s", dir),
|
||||
},
|
||||
9);
|
||||
return argv;
|
||||
}
|
||||
|
||||
static string_array_t *inpaint_image_node_qwen_args(char *dir) {
|
||||
string_array_t *argv = any_array_create_from_raw(
|
||||
(void *[]){
|
||||
string("%s/%s", dir, neural_node_sd_bin()),
|
||||
"--diffusion-model",
|
||||
string("%s/qwen-image-edit-2511-Q4_K_S.gguf", dir),
|
||||
"--vae",
|
||||
string("%s/Qwen_Image-VAE.safetensors", dir),
|
||||
"--llm",
|
||||
string("%s/Qwen2.5-VL-7B-Instruct-Q4_K_S.gguf", dir),
|
||||
"--llm_vision",
|
||||
string("%s/mmproj-F16.gguf", dir),
|
||||
"--qwen-image-zero-cond-t",
|
||||
"--steps",
|
||||
"30",
|
||||
},
|
||||
12);
|
||||
3);
|
||||
return argv;
|
||||
}
|
||||
|
||||
@@ -77,17 +51,6 @@ void inpaint_image_node_button_on_next_frame(ui_node_t *node) {
|
||||
}
|
||||
iron_write_png(string("%s%smask.png", dir, PATH_SEP), mask_buf, mask->width, mask->height, 0);
|
||||
}
|
||||
else {
|
||||
gpu_texture_t *masked = gpu_create_render_target(g_config->neural_res, g_config->neural_res, GPU_TEXTURE_FORMAT_RGBA32);
|
||||
draw_begin(masked, false, 0);
|
||||
draw_scaled_image(input, 0, 0, g_config->neural_res, g_config->neural_res);
|
||||
draw_set_pipeline(ui_view2d_pipe);
|
||||
gpu_set_int(ui_view2d_channel_loc, 6);
|
||||
draw_scaled_image(mask, 0, 0, g_config->neural_res, g_config->neural_res);
|
||||
draw_set_pipeline(NULL);
|
||||
draw_end();
|
||||
iron_write_png(string("%s%sinput.png", dir, PATH_SEP), gpu_get_texture_pixels(masked), masked->width, masked->height, 0);
|
||||
}
|
||||
|
||||
string_array_t *argv;
|
||||
if (model == 0) {
|
||||
@@ -99,21 +62,12 @@ void inpaint_image_node_button_on_next_frame(ui_node_t *node) {
|
||||
string_array_push(argv, "--mask");
|
||||
string_array_push(argv, string("%s/mask.png", dir));
|
||||
}
|
||||
else {
|
||||
argv = edit_image_node_qwen_args(dir);
|
||||
string_array_push(argv, "-p");
|
||||
string_array_push(argv, "remove red area");
|
||||
string_array_push(argv, "-r");
|
||||
string_array_push(argv, string("%s/input.png", dir));
|
||||
}
|
||||
|
||||
string_array_push(argv, "--cfg-scale");
|
||||
string_array_push(argv, "1.0");
|
||||
string_array_push(argv, "--diffusion-fa");
|
||||
string_array_push(argv, "--offload-to-cpu");
|
||||
string_array_push(argv, "--strength");
|
||||
string_array_push(argv, string("%f", inpaint_image_node_strength));
|
||||
string_array_push(argv, "-s");
|
||||
if (g_config->neural_res >= 2048) {
|
||||
string_array_push(argv, "--vae-tiling");
|
||||
}
|
||||
// string_array_push(argv, string("%f", inpaint_image_node_strength));
|
||||
string_array_push(argv, "--seed");
|
||||
string_array_push(argv, "-1");
|
||||
string_array_push(argv, "-W");
|
||||
string_array_push(argv, string("%d", g_config->neural_res));
|
||||
@@ -122,7 +76,7 @@ void inpaint_image_node_button_on_next_frame(ui_node_t *node) {
|
||||
string_array_push(argv, "-o");
|
||||
string_array_push(argv, string("%s/output.png", dir));
|
||||
if (inpaint_image_node_tiled) {
|
||||
string_array_push(argv, "--circular");
|
||||
string_array_push(argv, "--tileable");
|
||||
}
|
||||
string_array_push(argv, NULL);
|
||||
|
||||
@@ -140,9 +94,8 @@ void inpaint_image_node_button(i32 node_id) {
|
||||
string_array_t *models = any_array_create_from_raw(
|
||||
(void *[]){
|
||||
"FLUX 2 klein",
|
||||
"Qwen Image Edit",
|
||||
},
|
||||
2);
|
||||
1);
|
||||
i32 model = ui_combo(ui_nest(h, 0), models, tr("Model"), false, UI_ALIGN_LEFT, true);
|
||||
|
||||
ui_handle_t *hs = ui_nest(h, 1);
|
||||
|
||||
Reference in New Issue
Block a user