Pick correct sd binary
This commit is contained in:
@@ -780,7 +780,11 @@ function box_preferences_neural_tab() {
|
|||||||
if (inference_handle.init) {
|
if (inference_handle.init) {
|
||||||
inference_handle.i = config_raw.neural_backend;
|
inference_handle.i = config_raw.neural_backend;
|
||||||
}
|
}
|
||||||
|
/// if arm_windows
|
||||||
let inference_combo: string[] = [ "CPU", "Vulkan", "CUDA" ];
|
let inference_combo: string[] = [ "CPU", "Vulkan", "CUDA" ];
|
||||||
|
/// else
|
||||||
|
let inference_combo: string[] = [ "CPU", "Vulkan" ];
|
||||||
|
/// end
|
||||||
ui_combo(inference_handle, inference_combo, tr("Inference Backend"), true);
|
ui_combo(inference_handle, inference_combo, tr("Inference Backend"), true);
|
||||||
if (ui.is_hovered) {
|
if (ui.is_hovered) {
|
||||||
ui_tooltip(tr("Backend for neural node processing"));
|
ui_tooltip(tr("Backend for neural node processing"));
|
||||||
|
|||||||
@@ -277,6 +277,7 @@ enum layout_size_t {
|
|||||||
enum neural_backend_t {
|
enum neural_backend_t {
|
||||||
CPU = 0,
|
CPU = 0,
|
||||||
VULKAN = 1,
|
VULKAN = 1,
|
||||||
|
CUDA = 2,
|
||||||
}
|
}
|
||||||
|
|
||||||
enum preference_tab_t {
|
enum preference_tab_t {
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ function edit_image_node_button(node_id: i32) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let argv: string[] = [
|
let argv: string[] = [
|
||||||
dir + "/sd_vulkan",
|
dir + "/" + neural_node_sd_bin(),
|
||||||
"--diffusion-model",
|
"--diffusion-model",
|
||||||
dir + "/Qwen-Image-Edit-2509-Q4_K_S.gguf",
|
dir + "/Qwen-Image-Edit-2509-Q4_K_S.gguf",
|
||||||
"--vae",
|
"--vae",
|
||||||
@@ -50,6 +50,8 @@ function edit_image_node_button(node_id: i32) {
|
|||||||
"30",
|
"30",
|
||||||
"-s",
|
"-s",
|
||||||
"-1",
|
"-1",
|
||||||
|
"--cfg-scale", "2.5",
|
||||||
|
"--flow-shift", "3",
|
||||||
"-W",
|
"-W",
|
||||||
"512",
|
"512",
|
||||||
"-H",
|
"-H",
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ function image_to_depth_node_button(node_id: i32) {
|
|||||||
iron_write_png(dir + path_sep + "input.png", gpu_get_texture_pixels(input), input.width, input.height, 0);
|
iron_write_png(dir + path_sep + "input.png", gpu_get_texture_pixels(input), input.width, input.height, 0);
|
||||||
|
|
||||||
let argv: string[] = [
|
let argv: string[] = [
|
||||||
dir + "/sd_vulkan",
|
dir + "/" + neural_node_sd_bin(),
|
||||||
"-m",
|
"-m",
|
||||||
dir + "/marigold-depth-v1-1.q8_0.gguf",
|
dir + "/marigold-depth-v1-1.q8_0.gguf",
|
||||||
"--sampling-method",
|
"--sampling-method",
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ function image_to_normal_map_node_button(node_id: i32) {
|
|||||||
iron_write_png(dir + path_sep + "input.png", gpu_get_texture_pixels(input), input.width, input.height, 0);
|
iron_write_png(dir + path_sep + "input.png", gpu_get_texture_pixels(input), input.width, input.height, 0);
|
||||||
|
|
||||||
let argv: string[] = [
|
let argv: string[] = [
|
||||||
dir + "/sd_vulkan",
|
dir + "/" + neural_node_sd_bin(),
|
||||||
"-m",
|
"-m",
|
||||||
dir + "/marigold-normals-v1-1.q8_0.gguf",
|
dir + "/marigold-normals-v1-1.q8_0.gguf",
|
||||||
"--sampling-method",
|
"--sampling-method",
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ function image_to_pbr_node_run_sd(model: string, prompt: string, done: (tex: gpu
|
|||||||
let dir: string = neural_node_dir();
|
let dir: string = neural_node_dir();
|
||||||
|
|
||||||
let argv: string[] = [
|
let argv: string[] = [
|
||||||
dir + "/sd_vulkan",
|
dir + "/" + neural_node_sd_bin(),
|
||||||
"-m",
|
"-m",
|
||||||
dir + "/" + model,
|
dir + "/" + model,
|
||||||
"--sampling-method",
|
"--sampling-method",
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ function inpaint_image_node_button(node_id: i32) {
|
|||||||
let argv: string[];
|
let argv: string[];
|
||||||
if (model == 0) {
|
if (model == 0) {
|
||||||
argv = [
|
argv = [
|
||||||
dir + "/sd_vulkan",
|
dir + "/" + neural_node_sd_bin(),
|
||||||
"-m",
|
"-m",
|
||||||
dir + "/v1-5-pruned-emaonly.safetensors",
|
dir + "/v1-5-pruned-emaonly.safetensors",
|
||||||
"--steps",
|
"--steps",
|
||||||
@@ -89,7 +89,7 @@ function inpaint_image_node_button(node_id: i32) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
argv = [
|
argv = [
|
||||||
dir + "/sd_vulkan",
|
dir + "/" + neural_node_sd_bin(),
|
||||||
"--diffusion-model",
|
"--diffusion-model",
|
||||||
dir + "/Qwen-Image-Edit-2509-Q4_K_S.gguf",
|
dir + "/Qwen-Image-Edit-2509-Q4_K_S.gguf",
|
||||||
"--vae",
|
"--vae",
|
||||||
|
|||||||
@@ -77,6 +77,24 @@ function neural_node_check_result(node: ui_node_t) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function neural_node_sd_bin_ext(): string {
|
||||||
|
/// if arm_windows
|
||||||
|
return ".exe";
|
||||||
|
/// else
|
||||||
|
return "";
|
||||||
|
/// end
|
||||||
|
}
|
||||||
|
|
||||||
|
function neural_node_sd_bin(): string {
|
||||||
|
if (config_raw.neural_backend == neural_backend_t.VULKAN) {
|
||||||
|
return "sd_vulkan" + neural_node_sd_bin_ext();
|
||||||
|
}
|
||||||
|
if (config_raw.neural_backend == neural_backend_t.CUDA) {
|
||||||
|
return "sd_cuda" + neural_node_sd_bin_ext();
|
||||||
|
}
|
||||||
|
return "sd_cpu" + neural_node_sd_bin_ext();
|
||||||
|
}
|
||||||
|
|
||||||
function neural_node_dir(): string {
|
function neural_node_dir(): string {
|
||||||
let dir: string;
|
let dir: string;
|
||||||
if (path_is_protected()) {
|
if (path_is_protected()) {
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ function outpaint_image_node_button(node_id: i32) {
|
|||||||
let argv: string[];
|
let argv: string[];
|
||||||
if (model == 0) {
|
if (model == 0) {
|
||||||
argv = [
|
argv = [
|
||||||
dir + "/sd_vulkan",
|
dir + "/" + neural_node_sd_bin(),
|
||||||
"-m",
|
"-m",
|
||||||
dir + "/v1-5-pruned-emaonly.safetensors",
|
dir + "/v1-5-pruned-emaonly.safetensors",
|
||||||
"--offload-to-cpu",
|
"--offload-to-cpu",
|
||||||
@@ -86,7 +86,7 @@ function outpaint_image_node_button(node_id: i32) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
argv = [
|
argv = [
|
||||||
dir + "/sd_vulkan",
|
dir + "/" + neural_node_sd_bin(),
|
||||||
"--diffusion-model",
|
"--diffusion-model",
|
||||||
dir + "/Qwen-Image-Edit-2509-Q4_K_S.gguf",
|
dir + "/Qwen-Image-Edit-2509-Q4_K_S.gguf",
|
||||||
"--vae",
|
"--vae",
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ function text_to_image_node_init() {
|
|||||||
|
|
||||||
function text_to_image_node_sd_args(dir: string, prompt: string): string[] {
|
function text_to_image_node_sd_args(dir: string, prompt: string): string[] {
|
||||||
let argv: string[] = [
|
let argv: string[] = [
|
||||||
dir + "/sd_vulkan",
|
dir + "/" + neural_node_sd_bin(),
|
||||||
"-m",
|
"-m",
|
||||||
dir + "/v1-5-pruned-emaonly.safetensors",
|
dir + "/v1-5-pruned-emaonly.safetensors",
|
||||||
"--offload-to-cpu",
|
"--offload-to-cpu",
|
||||||
@@ -30,7 +30,7 @@ function text_to_image_node_sd_args(dir: string, prompt: string): string[] {
|
|||||||
|
|
||||||
function text_to_image_node_qwen_args(dir: string, prompt: string): string[] {
|
function text_to_image_node_qwen_args(dir: string, prompt: string): string[] {
|
||||||
let argv: string[] = [
|
let argv: string[] = [
|
||||||
dir + "/sd_vulkan",
|
dir + "/" + neural_node_sd_bin(),
|
||||||
"--diffusion-model",
|
"--diffusion-model",
|
||||||
dir + "/Qwen_Image-Q4_K_S.gguf",
|
dir + "/Qwen_Image-Q4_K_S.gguf",
|
||||||
"--vae",
|
"--vae",
|
||||||
@@ -59,7 +59,7 @@ function text_to_image_node_qwen_args(dir: string, prompt: string): string[] {
|
|||||||
|
|
||||||
function text_to_image_node_wan_args(dir: string, prompt: string): string[] {
|
function text_to_image_node_wan_args(dir: string, prompt: string): string[] {
|
||||||
let argv: string[] = [
|
let argv: string[] = [
|
||||||
dir + "/sd_vulkan",
|
dir + "/" + neural_node_sd_bin(),
|
||||||
"-M",
|
"-M",
|
||||||
"vid_gen",
|
"vid_gen",
|
||||||
"--diffusion-model",
|
"--diffusion-model",
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ function tile_image_node_button(node_id: i32) {
|
|||||||
let argv: string[];
|
let argv: string[];
|
||||||
if (model == 0) {
|
if (model == 0) {
|
||||||
argv = [
|
argv = [
|
||||||
dir + "/sd_vulkan",
|
dir + "/" + neural_node_sd_bin(),
|
||||||
"-m",
|
"-m",
|
||||||
dir + "/v1-5-pruned-emaonly.safetensors",
|
dir + "/v1-5-pruned-emaonly.safetensors",
|
||||||
"--offload-to-cpu",
|
"--offload-to-cpu",
|
||||||
@@ -89,7 +89,7 @@ function tile_image_node_button(node_id: i32) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
argv = [
|
argv = [
|
||||||
dir + "/sd_vulkan",
|
dir + "/" + neural_node_sd_bin(),
|
||||||
"--diffusion-model",
|
"--diffusion-model",
|
||||||
dir + "/Qwen-Image-Edit-2509-Q4_K_S.gguf",
|
dir + "/Qwen-Image-Edit-2509-Q4_K_S.gguf",
|
||||||
"--vae",
|
"--vae",
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ function upscale_image_node_init() {
|
|||||||
function upscale_image_node_button(node_id: i32) {
|
function upscale_image_node_button(node_id: i32) {
|
||||||
let canvas: ui_node_canvas_t = ui_nodes_get_canvas(true);
|
let canvas: ui_node_canvas_t = ui_nodes_get_canvas(true);
|
||||||
let node: ui_node_t = ui_get_node(canvas.nodes, node_id);
|
let node: ui_node_t = ui_get_node(canvas.nodes, node_id);
|
||||||
let node_name: string = parser_material_node_name(node);
|
let node_name: string = parser_material_node_name(node);
|
||||||
let h: ui_handle_t = ui_handle(node_name);
|
let h: ui_handle_t = ui_handle(node_name);
|
||||||
|
|
||||||
let models: string[] = [ "Real-ESRGAN" ];
|
let models: string[] = [ "Real-ESRGAN" ];
|
||||||
let model: i32 = ui_combo(ui_nest(h, 0), models, tr("Model"));
|
let model: i32 = ui_combo(ui_nest(h, 0), models, tr("Model"));
|
||||||
@@ -27,8 +27,10 @@ function upscale_image_node_button(node_id: i32) {
|
|||||||
let dir: string = neural_node_dir();
|
let dir: string = neural_node_dir();
|
||||||
iron_write_png(dir + path_sep + "input.png", input_buf, input.width, input.height, 0);
|
iron_write_png(dir + path_sep + "input.png", input_buf, input.width, input.height, 0);
|
||||||
|
|
||||||
let argv: string[] =
|
let argv: string[] = [
|
||||||
[ dir + "/sd_vulkan", "-M", "upscale", "--upscale-model", dir + "/RealESRGAN_x4plus.pth", "-i", dir + "/input.png", "-o", dir + "/output.png", null ];
|
dir + "/" + neural_node_sd_bin(), "-M", "upscale", "--upscale-model", dir + "/RealESRGAN_x4plus.pth", "-i", dir + "/input.png", "-o",
|
||||||
|
dir + "/output.png", null
|
||||||
|
];
|
||||||
iron_exec_async(argv[0], argv.buffer);
|
iron_exec_async(argv[0], argv.buffer);
|
||||||
sys_notify_on_update(neural_node_check_result, node);
|
sys_notify_on_update(neural_node_check_result, node);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ function vary_image_node_button(node_id: i32) {
|
|||||||
let argv: string[];
|
let argv: string[];
|
||||||
if (model == 0) {
|
if (model == 0) {
|
||||||
argv = [
|
argv = [
|
||||||
dir + "/sd_vulkan",
|
dir + "/" + neural_node_sd_bin(),
|
||||||
"-m",
|
"-m",
|
||||||
dir + "/v1-5-pruned-emaonly.safetensors",
|
dir + "/v1-5-pruned-emaonly.safetensors",
|
||||||
"--offload-to-cpu",
|
"--offload-to-cpu",
|
||||||
@@ -79,7 +79,7 @@ function vary_image_node_button(node_id: i32) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
argv = [
|
argv = [
|
||||||
dir + "/sd_vulkan",
|
dir + "/" + neural_node_sd_bin(),
|
||||||
"--diffusion-model",
|
"--diffusion-model",
|
||||||
dir + "/Qwen-Image-Edit-2509-Q4_K_S.gguf",
|
dir + "/Qwen-Image-Edit-2509-Q4_K_S.gguf",
|
||||||
"--vae",
|
"--vae",
|
||||||
|
|||||||
Reference in New Issue
Block a user