wxWidgets based Stable Diffusion C++ GUi
Ferenc Szontágh
2024-02-03 875477e097c353a368b5fbf5b5f048c956fc4743
initial commit
2 files modified
64 files added
8853 ■■■■■ changed files
.gitignore 2 ●●●●● patch | view | raw | blame | history
.vscode/extensions.json 7 ●●●●● patch | view | raw | blame | history
.vscode/launch.json 28 ●●●●● patch | view | raw | blame | history
.vscode/settings.json 104 ●●●●● patch | view | raw | blame | history
CMakeLists.txt 101 ●●●●● patch | view | raw | blame | history
CMakePresets.json 12 ●●●●● patch | view | raw | blame | history
CMakeUserPresets.json 12 ●●●●● patch | view | raw | blame | history
README.md 20 ●●●●● patch | view | raw | blame | history
external/ggml/Debug/ggml.pdb patch | view | raw | blame | history
external/ggml/Debug/lib/ggml.exp patch | view | raw | blame | history
external/ggml/Debug/lib/ggml.pdb patch | view | raw | blame | history
external/ggml/Release/lib/ggml.exp patch | view | raw | blame | history
external/stable-diffusion.cpp/Debug/lib/stable-diffusion.pdb patch | view | raw | blame | history
external/stable-diffusion.cpp/Debug/stable-diffusion.pdb patch | view | raw | blame | history
external/stable-diffusion.cpp/Release/lib/stable-diffusion.exp patch | view | raw | blame | history
external/stable-diffusion.cpp/include/stable-diffusion.h 160 ●●●●● patch | view | raw | blame | history
external/stable-diffusion.cpp/include/stable-diffusion_master.h 165 ●●●●● patch | view | raw | blame | history
main.cpp 25 ●●●●● patch | view | raw | blame | history
ui/MainWindow.cpp 562 ●●●●● patch | view | raw | blame | history
ui/MainWindow.h 182 ●●●●● patch | view | raw | blame | history
ui/MainWindowImageViewer.cpp 8 ●●●●● patch | view | raw | blame | history
ui/MainWindowImageViewer.h 39 ●●●●● patch | view | raw | blame | history
ui/MainWindowSettings.cpp 73 ●●●●● patch | view | raw | blame | history
ui/MainWindowSettings.h 65 ●●●●● patch | view | raw | blame | history
ui/MainWindowUI.cpp 875 ●●●●● patch | view | raw | blame | history
ui/MainWindowUI.h 106 ●●●●● patch | view | raw | blame | history
ui/QueueManager.cpp 129 ●●●●● patch | view | raw | blame | history
ui/QueueManager.h 116 ●●●●● patch | view | raw | blame | history
ui/embended_files/cube.png.h 59 ●●●●● patch | view | raw | blame | history
ui/embended_files/disk.png.h 56 ●●●●● patch | view | raw | blame | history
ui/embended_files/file_import.png.h 53 ●●●●● patch | view | raw | blame | history
ui/embended_files/forward.png.h 51 ●●●●● patch | view | raw | blame | history
ui/embended_files/images.png.h 61 ●●●●● patch | view | raw | blame | history
ui/embended_files/palette.png.h 68 ●●●●● patch | view | raw | blame | history
ui/embended_files/pause.png.h 46 ●●●●● patch | view | raw | blame | history
ui/embended_files/picture.png.h 60 ●●●●● patch | view | raw | blame | history
ui/embended_files/play.png.h 48 ●●●●● patch | view | raw | blame | history
ui/embended_files/refresh.png.h 61 ●●●●● patch | view | raw | blame | history
ui/embended_files/replace.png.h 62 ●●●●● patch | view | raw | blame | history
ui/embended_files/rotate-right.png.h 60 ●●●●● patch | view | raw | blame | history
ui/embended_files/rotate_right.png.h 60 ●●●●● patch | view | raw | blame | history
ui/embended_files/settings.png.h 62 ●●●●● patch | view | raw | blame | history
ui/embended_files/text_box_dots.png.h 55 ●●●●● patch | view | raw | blame | history
ui/embended_files/trash.png.h 49 ●●●●● patch | view | raw | blame | history
ui/icons/16/cross_circle.png patch | view | raw | blame | history
ui/icons/16/cube.png patch | view | raw | blame | history
ui/icons/16/disk.png patch | view | raw | blame | history
ui/icons/16/file_import.png patch | view | raw | blame | history
ui/icons/16/forward.png patch | view | raw | blame | history
ui/icons/16/images.png patch | view | raw | blame | history
ui/icons/16/palette.png patch | view | raw | blame | history
ui/icons/16/pause.png patch | view | raw | blame | history
ui/icons/16/picture.png patch | view | raw | blame | history
ui/icons/16/play.png patch | view | raw | blame | history
ui/icons/16/refresh.png patch | view | raw | blame | history
ui/icons/16/replace.png patch | view | raw | blame | history
ui/icons/16/rewind.png patch | view | raw | blame | history
ui/icons/16/rotate_right.png patch | view | raw | blame | history
ui/icons/16/settings.png patch | view | raw | blame | history
ui/icons/16/text_box_dots.png patch | view | raw | blame | history
ui/icons/16/trash.png patch | view | raw | blame | history
ui/utils.hpp 383 ●●●●● patch | view | raw | blame | history
ui/ver.hpp 5 ●●●●● patch | view | raw | blame | history
ui/windows.fbp 4740 ●●●●● patch | view | raw | blame | history
vcpkg-configuration.json 14 ●●●●● patch | view | raw | blame | history
vcpkg.json 9 ●●●●● patch | view | raw | blame | history
.gitignore
@@ -19,3 +19,5 @@
*.exe
*.out
*.app
vcpkg_installed
build/**
.vscode/extensions.json
New file
@@ -0,0 +1,7 @@
{
    "recommendations": [
        "wayou.vscode-todo-highlight",
        "ms-vscode.cpptools",
        "jeff-hykin.better-cpp-syntax"
    ]
}
.vscode/launch.json
New file
@@ -0,0 +1,28 @@
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(msvc) Launch",
            "type": "cppvsdbg",
            "request": "launch",
            // Resolved by CMake Tools:
            "program": "${command:cmake.launchTargetPath}",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [
                {
                    // add the directory where our target was built to the PATHs
                    // it gets resolved by CMake Tools:
                    "name": "PATH",
                    "value": "${env:PATH}:${command:cmake.getLaunchTargetDirectory}"
                },
                {
                    "name": "OTHER_VALUE",
                    "value": "Something something"
                }
            ],
            "console": "externalTerminal"
        }
    ]
}
.vscode/settings.json
New file
@@ -0,0 +1,104 @@
{
    "files.associations": {
        "algorithm": "cpp",
        "array": "cpp",
        "atomic": "cpp",
        "bit": "cpp",
        "bitset": "cpp",
        "cctype": "cpp",
        "charconv": "cpp",
        "chrono": "cpp",
        "clocale": "cpp",
        "cmath": "cpp",
        "compare": "cpp",
        "concepts": "cpp",
        "coroutine": "cpp",
        "cstddef": "cpp",
        "cstdint": "cpp",
        "cstdio": "cpp",
        "cstdlib": "cpp",
        "cstring": "cpp",
        "ctime": "cpp",
        "cwchar": "cpp",
        "deque": "cpp",
        "exception": "cpp",
        "filesystem": "cpp",
        "format": "cpp",
        "forward_list": "cpp",
        "fstream": "cpp",
        "functional": "cpp",
        "hash_map": "cpp",
        "hash_set": "cpp",
        "initializer_list": "cpp",
        "iomanip": "cpp",
        "ios": "cpp",
        "iosfwd": "cpp",
        "iostream": "cpp",
        "istream": "cpp",
        "iterator": "cpp",
        "limits": "cpp",
        "list": "cpp",
        "locale": "cpp",
        "map": "cpp",
        "memory": "cpp",
        "new": "cpp",
        "numeric": "cpp",
        "optional": "cpp",
        "ostream": "cpp",
        "queue": "cpp",
        "ranges": "cpp",
        "ratio": "cpp",
        "source_location": "cpp",
        "span": "cpp",
        "sstream": "cpp",
        "stack": "cpp",
        "stdexcept": "cpp",
        "stop_token": "cpp",
        "streambuf": "cpp",
        "string": "cpp",
        "system_error": "cpp",
        "thread": "cpp",
        "tuple": "cpp",
        "type_traits": "cpp",
        "typeinfo": "cpp",
        "unordered_map": "cpp",
        "unordered_set": "cpp",
        "utility": "cpp",
        "variant": "cpp",
        "vector": "cpp",
        "xfacet": "cpp",
        "xhash": "cpp",
        "xiosbase": "cpp",
        "xlocale": "cpp",
        "xlocbuf": "cpp",
        "xlocinfo": "cpp",
        "xlocmes": "cpp",
        "xlocmon": "cpp",
        "xlocnum": "cpp",
        "xloctime": "cpp",
        "xmemory": "cpp",
        "xstring": "cpp",
        "xtr1common": "cpp",
        "xtree": "cpp",
        "xutility": "cpp",
        "__nullptr": "cpp",
        "cstdarg": "cpp",
        "cwctype": "cpp",
        "mutex": "cpp",
        "__bit_reference": "cpp",
        "__hash_table": "cpp",
        "__split_buffer": "cpp",
        "__tree": "cpp",
        "string_view": "cpp",
        "__string": "cpp",
        "set": "cpp",
        "any": "cpp",
        "cinttypes": "cpp",
        "codecvt": "cpp",
        "complex": "cpp",
        "random": "cpp",
        "regex": "cpp",
        "typeindex": "cpp",
        "valarray": "cpp"
    }
}
CMakeLists.txt
New file
@@ -0,0 +1,101 @@
cmake_minimum_required(VERSION 3.10)
project(sd.ui)
set (CMAKE_CXX_STANDARD 20)
option(SD_CUBLAS                     "sd: cuda backend" ON)
option(SD_HIPBLAS                    "sd: rocm backend" OFF)
option(SD_METAL                      "sd: metal backend" OFF)
set(SD_CUBLAS ON)
    #enable_language(CUDA)
message("CUDA ON")
IF(MSVC)
    SET(OPTIONS WIN32)
ENDIF(MSVC)
add_executable(sd.ui ${OPTIONS} main.cpp ui/MainWindow.cpp ui/MainWindowSettings.cpp ui/MainWindowUi.cpp ui/MainWindowImageViewer.cpp ui/QueueManager.cpp)
include_directories(${CMAKE_SOURCE_DIR}/external/stable-diffusion.cpp/include)
link_directories(${CMAKE_SOURCE_DIR}/external/stable-diffusion.cpp/lib)
IF(MSVC)
        set(CUDA_PATH "$ENV{CUDA_PATH}")
    if(NOT CMAKE_BUILD_TYPE)
        set(CMAKE_BUILD_TYPE Debug)
    endif()
    set(STABLE_DIFFUSION_LIB ${CMAKE_SOURCE_DIR}/external/stable-diffusion.cpp/${CMAKE_BUILD_TYPE}/lib/stable-diffusion.lib)
    set(GGML_LIB ${CMAKE_SOURCE_DIR}/external/ggml/${CMAKE_BUILD_TYPE}/lib/ggml.lib)
    set(STABLE_DIFFUSION_DLL ${CMAKE_SOURCE_DIR}/external/stable-diffusion.cpp/${CMAKE_BUILD_TYPE}/stable-diffusion.dll)
    set(GGML_DLL ${CMAKE_SOURCE_DIR}/external/ggml/${CMAKE_BUILD_TYPE}/ggml.dll)
    add_library(SDLIB SHARED IMPORTED)
    set_property(TARGET SDLIB PROPERTY IMPORTED_LOCATION "${STABLE_DIFFUSION_DLL}")
    set_property(TARGET SDLIB PROPERTY IMPORTED_IMPLIB "${STABLE_DIFFUSION_LIB}")
    add_library(GGMLLIB SHARED IMPORTED)
    set_property(TARGET GGMLLIB PROPERTY IMPORTED_LOCATION "${GGML_DLL}")
    set_property(TARGET GGMLLIB PROPERTY IMPORTED_IMPLIB "${GGML_LIB}")
    message("STABLE_DIFFUSION_LIB=" ${STABLE_DIFFUSION_LIB})
    message("GGML_LIB=" ${GGML_LIB})
    message("CUDA_PATH=" ${CUDA_PATH})
ENDIF(MSVC)
set(OpenCV_DIR "${VCPKG_INSTALLED_DIR}/x64-windows/share/opencv4")
find_package(OpenCV REQUIRED)
if( OpenCV_FOUND )
  # Additional Include Directories
  include_directories( ${OpenCV_INCLUDE_DIRS} )
  # Additional Library Directories
  link_directories( ${OpenCV_LIB_DIR} )
  # Additional Dependencies
  # target_link_libraries(sd.ui ${OpenCV_LIBS} )
endif()
find_package(fmt CONFIG REQUIRED)
find_package(wxWidgets CONFIG REQUIRED)
find_package(nlohmann_json CONFIG REQUIRED)
find_package(CUDAToolkit REQUIRED)
set(CUDA_LIB_PATH "C:/CUDA/lib/x64")
message("CUDA_LIB_PATH=" ${CUDA_LIB_PATH})
target_compile_definitions(sd.ui PRIVATE ${wxWidgets_DEFINITIONS} "$<$<CONFIG:DEBUG>:${wxWidgets_DEFINITIONS_DEBUG}>")
target_include_directories(sd.ui PRIVATE ${wxWidgets_INCLUDE_DIRS})
target_link_libraries(sd.ui ${CUDA_LIBRARIES})
target_link_libraries(sd.ui PRIVATE ${OpenCV_LIBS} nlohmann_json::nlohmann_json fmt::fmt wx::core wx::base wx::xrc wx::adv wx::richtext wx::aui SDLIB GGMLLIB CUDA::cudart CUDA::cublas CUDA::cublasLt CUDA::cuda_driver)
include_directories(ui)
CMakePresets.json
New file
@@ -0,0 +1,12 @@
{
    "version": 3,
    "configurePresets": [
        {
            "name": "default",
            "binaryDir": "${sourceDir}/build",
            "cacheVariables": {
                "CMAKE_TOOLCHAIN_FILE": "Z:/vcpkg/scripts/buildsystems/vcpkg.cmake"
            }
        }
    ]
}
CMakeUserPresets.json
New file
@@ -0,0 +1,12 @@
{
    "version": 3,
    "configurePresets": [
        {
            "name": "default",
            "inherits": "vcpkg",
            "environment": {
                "VCPKG_ROOT": "Z:/vcpkg"
            }
        }
    ]
}
README.md
@@ -2,3 +2,23 @@
wxWidgets based Stable Diffusion C++ GUi
Created by Ferenc Szontágh <szf@fsociety.hu> @2024-01-30
No licence yet...
### - Prepare
* install vcpkg on your system...
* configure the vcpkg in CMakePresets.json and CMakeUserPresets.json
* run configure, itt will be ~15mins to download and configure the dependencies
### - Externals!
in the external forlder, you can find the precompuled stable-diffusion.cpp and ggml as submodulde to it.
The default libs are configured with only CUDA, the release is Debug and Release. To use with another version (for example cpu only), you need to compile and overwrite
## - TO-DOs
See @git.spamming.hu ticketing system
### - IDE
Use the vscode... Install the extensions which is recommended by the workspace
external/ggml/Debug/ggml.pdb
Binary files differ
external/ggml/Debug/lib/ggml.exp
Binary files differ
external/ggml/Debug/lib/ggml.pdb
Binary files differ
external/ggml/Release/lib/ggml.exp
Binary files differ
external/stable-diffusion.cpp/Debug/lib/stable-diffusion.pdb
Binary files differ
external/stable-diffusion.cpp/Debug/stable-diffusion.pdb
Binary files differ
external/stable-diffusion.cpp/Release/lib/stable-diffusion.exp
Binary files differ
external/stable-diffusion.cpp/include/stable-diffusion.h
New file
@@ -0,0 +1,160 @@
#ifndef __STABLE_DIFFUSION_H__
#define __STABLE_DIFFUSION_H__
#if defined(_WIN32) || defined(__CYGWIN__)
#ifndef SD_BUILD_SHARED_LIB
#define SD_API
#else
#ifdef SD_BUILD_DLL
#define SD_API __declspec(dllexport)
#else
#define SD_API __declspec(dllimport)
#endif
#endif
#else
#if __GNUC__ >= 4
#define SD_API __attribute__((visibility("default")))
#else
#define SD_API
#endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
enum rng_type_t {
    STD_DEFAULT_RNG,
    CUDA_RNG
};
enum sample_method_t {
    EULER_A,
    EULER,
    HEUN,
    DPM2,
    DPMPP2S_A,
    DPMPP2M,
    DPMPP2Mv2,
    LCM,
    N_SAMPLE_METHODS
};
enum schedule_t {
    DEFAULT,
    DISCRETE,
    KARRAS,
    N_SCHEDULES
};
// same as enum ggml_type
enum sd_type_t {
    SD_TYPE_F32  = 0,
    SD_TYPE_F16  = 1,
    SD_TYPE_Q4_0 = 2,
    SD_TYPE_Q4_1 = 3,
    // SD_TYPE_Q4_2 = 4, support has been removed
    // SD_TYPE_Q4_3 (5) support has been removed
    SD_TYPE_Q5_0 = 6,
    SD_TYPE_Q5_1 = 7,
    SD_TYPE_Q8_0 = 8,
    SD_TYPE_Q8_1 = 9,
    // k-quantizations
    SD_TYPE_Q2_K = 10,
    SD_TYPE_Q3_K = 11,
    SD_TYPE_Q4_K = 12,
    SD_TYPE_Q5_K = 13,
    SD_TYPE_Q6_K = 14,
    SD_TYPE_Q8_K = 15,
    SD_TYPE_IQ2_XXS = 16,
    SD_TYPE_I8,
    SD_TYPE_I16,
    SD_TYPE_I32,
    SD_TYPE_COUNT,
};
SD_API const char* sd_type_name(enum sd_type_t type);
enum sd_log_level_t {
    SD_LOG_DEBUG,
    SD_LOG_INFO,
    SD_LOG_WARN,
    SD_LOG_ERROR
};
typedef void (*sd_log_cb_t)(enum sd_log_level_t level, const char* text, void* data);
SD_API void sd_set_log_callback(sd_log_cb_t sd_log_cb, void* data);
SD_API int32_t get_num_physical_cores();
SD_API const char* sd_get_system_info();
typedef struct {
    uint32_t width;
    uint32_t height;
    uint32_t channel;
    uint8_t* data;
} sd_image_t;
typedef struct sd_ctx_t sd_ctx_t;
SD_API sd_ctx_t* new_sd_ctx(const char* model_path,
                            const char* vae_path,
                            const char* taesd_path,
                            const char* lora_model_dir,
                            bool vae_decode_only,
                            bool vae_tiling,
                            bool free_params_immediately,
                            int n_threads,
                            enum sd_type_t wtype,
                            enum rng_type_t rng_type,
                            enum schedule_t s);
SD_API void free_sd_ctx(sd_ctx_t* sd_ctx);
SD_API sd_image_t* txt2img(sd_ctx_t* sd_ctx,
                           const char* prompt,
                           const char* negative_prompt,
                           int clip_skip,
                           float cfg_scale,
                           int width,
                           int height,
                           enum sample_method_t sample_method,
                           int sample_steps,
                           int64_t seed,
                           int batch_count);
SD_API sd_image_t* img2img(sd_ctx_t* sd_ctx,
                           sd_image_t init_image,
                           const char* prompt,
                           const char* negative_prompt,
                           int clip_skip,
                           float cfg_scale,
                           int width,
                           int height,
                           enum sample_method_t sample_method,
                           int sample_steps,
                           float strength,
                           int64_t seed,
                           int batch_count);
typedef struct upscaler_ctx_t upscaler_ctx_t;
SD_API upscaler_ctx_t* new_upscaler_ctx(const char* esrgan_path,
                                        int n_threads,
                                        enum sd_type_t wtype);
SD_API void free_upscaler_ctx(upscaler_ctx_t* upscaler_ctx);
SD_API sd_image_t upscale(upscaler_ctx_t* upscaler_ctx, sd_image_t input_image, uint32_t upscale_factor);
SD_API bool convert(const char* input_path, const char* vae_path, const char* output_path, sd_type_t output_type);
#ifdef __cplusplus
}
#endif
#endif  // __STABLE_DIFFUSION_H__
external/stable-diffusion.cpp/include/stable-diffusion_master.h
New file
@@ -0,0 +1,165 @@
#ifndef __STABLE_DIFFUSION_H__
#define __STABLE_DIFFUSION_H__
#if defined(_WIN32) || defined(__CYGWIN__)
#ifndef SD_BUILD_SHARED_LIB
#define SD_API
#else
#ifdef SD_BUILD_DLL
#define SD_API __declspec(dllexport)
#else
#define SD_API __declspec(dllimport)
#endif
#endif
#else
#if __GNUC__ >= 4
#define SD_API __attribute__((visibility("default")))
#else
#define SD_API
#endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
enum rng_type_t {
    STD_DEFAULT_RNG,
    CUDA_RNG
};
enum sample_method_t {
    EULER_A,
    EULER,
    HEUN,
    DPM2,
    DPMPP2S_A,
    DPMPP2M,
    DPMPP2Mv2,
    LCM,
    N_SAMPLE_METHODS
};
enum schedule_t {
    DEFAULT,
    DISCRETE,
    KARRAS,
    N_SCHEDULES
};
// same as enum ggml_type
enum sd_type_t {
    SD_TYPE_F32  = 0,
    SD_TYPE_F16  = 1,
    SD_TYPE_Q4_0 = 2,
    SD_TYPE_Q4_1 = 3,
    // SD_TYPE_Q4_2 = 4, support has been removed
    // SD_TYPE_Q4_3 (5) support has been removed
    SD_TYPE_Q5_0 = 6,
    SD_TYPE_Q5_1 = 7,
    SD_TYPE_Q8_0 = 8,
    SD_TYPE_Q8_1 = 9,
    // k-quantizations
    SD_TYPE_Q2_K    = 10,
    SD_TYPE_Q3_K    = 11,
    SD_TYPE_Q4_K    = 12,
    SD_TYPE_Q5_K    = 13,
    SD_TYPE_Q6_K    = 14,
    SD_TYPE_Q8_K    = 15,
    SD_TYPE_IQ2_XXS = 16,
    SD_TYPE_I8,
    SD_TYPE_I16,
    SD_TYPE_I32,
    SD_TYPE_COUNT,
};
SD_API const char* sd_type_name(enum sd_type_t type);
enum sd_log_level_t {
    SD_LOG_DEBUG,
    SD_LOG_INFO,
    SD_LOG_WARN,
    SD_LOG_ERROR
};
typedef void (*sd_log_cb_t)(enum sd_log_level_t level, const char* text, void* data);
SD_API void sd_set_log_callback(sd_log_cb_t sd_log_cb, void* data);
SD_API int32_t get_num_physical_cores();
SD_API const char* sd_get_system_info();
typedef struct {
    uint32_t width;
    uint32_t height;
    uint32_t channel;
    uint8_t* data;
} sd_image_t;
typedef struct sd_ctx_t sd_ctx_t;
SD_API sd_ctx_t* new_sd_ctx(const char* model_path,
                            const char* vae_path,
                            const char* taesd_path,
                            const char* control_net_path_c_str,
                            const char* lora_model_dir,
                            const char* embed_dir_c_str,
                            bool vae_decode_only,
                            bool vae_tiling,
                            bool free_params_immediately,
                            int n_threads,
                            enum sd_type_t wtype,
                            enum rng_type_t rng_type,
                            enum schedule_t s,
                            bool keep_control_net_cpu);
SD_API void free_sd_ctx(sd_ctx_t* sd_ctx);
SD_API sd_image_t* txt2img(sd_ctx_t* sd_ctx,
                           const char* prompt,
                           const char* negative_prompt,
                           int clip_skip,
                           float cfg_scale,
                           int width,
                           int height,
                           enum sample_method_t sample_method,
                           int sample_steps,
                           int64_t seed,
                           int batch_count,
                           const sd_image_t* control_cond,
                           float control_strength);
SD_API sd_image_t* img2img(sd_ctx_t* sd_ctx,
                           sd_image_t init_image,
                           const char* prompt,
                           const char* negative_prompt,
                           int clip_skip,
                           float cfg_scale,
                           int width,
                           int height,
                           enum sample_method_t sample_method,
                           int sample_steps,
                           float strength,
                           int64_t seed,
                           int batch_count);
typedef struct upscaler_ctx_t upscaler_ctx_t;
SD_API upscaler_ctx_t* new_upscaler_ctx(const char* esrgan_path,
                                        int n_threads,
                                        enum sd_type_t wtype);
SD_API void free_upscaler_ctx(upscaler_ctx_t* upscaler_ctx);
SD_API sd_image_t upscale(upscaler_ctx_t* upscaler_ctx, sd_image_t input_image, uint32_t upscale_factor);
SD_API bool convert(const char* input_path, const char* vae_path, const char* output_path, sd_type_t output_type);
#ifdef __cplusplus
}
#endif
#endif  // __STABLE_DIFFUSION_H__
main.cpp
New file
@@ -0,0 +1,25 @@
#include <wx/app.h>
#include <wx/event.h>
#include "MainWindowUi.h"
#include <wx/image.h>
// Define the MainApp
class MainApp : public wxApp
{
public:
    MainApp() {}
    virtual ~MainApp() {}
    virtual bool OnInit()
    {
        // Add the common image handlers
        wxImage::AddHandler(new wxPNGHandler);
        wxImage::AddHandler(new wxJPEGHandler);
        MainWindowUI *mainFrame = new MainWindowUI(nullptr);
        SetTopWindow(mainFrame);
        return GetTopWindow()->Show();
    }
};
DECLARE_APP(MainApp)
IMPLEMENT_APP(MainApp)
ui/MainWindow.cpp
New file
@@ -0,0 +1,562 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "MainWindow.h"
#include "embended_files/cube.png.h"
#include "embended_files/disk.png.h"
#include "embended_files/file_import.png.h"
#include "embended_files/forward.png.h"
#include "embended_files/images.png.h"
#include "embended_files/palette.png.h"
#include "embended_files/pause.png.h"
#include "embended_files/picture.png.h"
#include "embended_files/play.png.h"
#include "embended_files/refresh.png.h"
#include "embended_files/replace.png.h"
#include "embended_files/settings.png.h"
#include "embended_files/text_box_dots.png.h"
#include "embended_files/trash.png.h"
///////////////////////////////////////////////////////////////////////////
UI::UI( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
    this->SetSizeHints( wxDefaultSize, wxDefaultSize );
    wxBoxSizer* sizer0001;
    sizer0001 = new wxBoxSizer( wxVERTICAL );
    sizer0001->SetMinSize( wxSize( 800,600 ) );
    m_all_panel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
    wxBoxSizer* sizer0002;
    sizer0002 = new wxBoxSizer( wxVERTICAL );
    wxBoxSizer* sizer0021;
    sizer0021 = new wxBoxSizer( wxHORIZONTAL );
    m_settings = new wxButton( m_all_panel, wxID_ANY, wxT("Settings"), wxDefaultPosition, wxDefaultSize, 0 );
    m_settings->SetBitmap( settings_png_to_wx_bitmap() );
    sizer0021->Add( m_settings, 0, wxALL, 5 );
    m_refresh = new wxButton( m_all_panel, wxID_ANY, wxT("Refresh"), wxDefaultPosition, wxDefaultSize, 0 );
    m_refresh->SetBitmap( refresh_png_to_wx_bitmap() );
    sizer0021->Add( m_refresh, 0, wxALL, 5 );
    m_staticText160 = new wxStaticText( m_all_panel, wxID_ANY, wxT("Model"), wxDefaultPosition, wxDefaultSize, 0 );
    m_staticText160->Wrap( 0 );
    sizer0021->Add( m_staticText160, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
    wxArrayString m_modelChoices;
    m_model = new wxChoice( m_all_panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_modelChoices, 0 );
    m_model->SetSelection( 0 );
    m_model->Enable( false );
    sizer0021->Add( m_model, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
    m_staticText161 = new wxStaticText( m_all_panel, wxID_ANY, wxT("Vae"), wxDefaultPosition, wxDefaultSize, 0 );
    m_staticText161->Wrap( 0 );
    sizer0021->Add( m_staticText161, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
    wxArrayString m_vaeChoices;
    m_vae = new wxChoice( m_all_panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_vaeChoices, 0 );
    m_vae->SetSelection( 0 );
    m_vae->Enable( false );
    sizer0021->Add( m_vae, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
    m_staticText163 = new wxStaticText( m_all_panel, wxID_ANY, wxT("Sampler"), wxDefaultPosition, wxDefaultSize, 0 );
    m_staticText163->Wrap( 0 );
    m_staticText163->SetToolTip( wxT("sampling method (default: \"euler_a\")") );
    sizer0021->Add( m_staticText163, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
    wxArrayString m_samplerChoices;
    m_sampler = new wxChoice( m_all_panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_samplerChoices, 0 );
    m_sampler->SetSelection( 0 );
    m_sampler->SetToolTip( wxT("sampling method (default: \"euler_a\")") );
    sizer0021->Add( m_sampler, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
    sizer0002->Add( sizer0021, 0, wxALL|wxEXPAND, 5 );
    wxBoxSizer* sizer0003;
    sizer0003 = new wxBoxSizer( wxHORIZONTAL );
    m_staticText231 = new wxStaticText( m_all_panel, wxID_ANY, wxT("CFG:"), wxDefaultPosition, wxDefaultSize, 0 );
    m_staticText231->Wrap( 0 );
    sizer0003->Add( m_staticText231, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
    m_cfg = new wxSpinCtrlDouble( m_all_panel, wxID_ANY, wxT("7.0"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL|wxSP_ARROW_KEYS, 0, 15, 0, 0.1 );
    m_cfg->SetDigits( 1 );
    sizer0003->Add( m_cfg, 0, wxALL, 5 );
    m_staticText233 = new wxStaticText( m_all_panel, wxID_ANY, wxT("Seed:"), wxDefaultPosition, wxDefaultSize, 0 );
    m_staticText233->Wrap( 0 );
    sizer0003->Add( m_staticText233, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
    m_seed = new wxSpinCtrl( m_all_panel, wxID_ANY, wxT("44"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 9999999, 44 );
    sizer0003->Add( m_seed, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
    m_staticText234 = new wxStaticText( m_all_panel, wxID_ANY, wxT("Clip skip:"), wxDefaultPosition, wxDefaultSize, 0 );
    m_staticText234->Wrap( 0 );
    m_staticText234->SetToolTip( wxT("ignore last layers of CLIP network; 1 ignores none, 2 ignores one layer (default: -1)\n<= 0 represents unspecified, will be 1 for SD1.x, 2 for SD2.x") );
    sizer0003->Add( m_staticText234, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
    m_clip_skip = new wxSpinCtrl( m_all_panel, wxID_ANY, wxT("0"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, -1, 2, 0 );
    m_clip_skip->SetToolTip( wxT("ignore last layers of CLIP network; 1 ignores none, 2 ignores one layer (default: -1)\n<= 0 represents unspecified, will be 1 for SD1.x, 2 for SD2.x") );
    sizer0003->Add( m_clip_skip, 0, wxALL, 5 );
    m_staticText14 = new wxStaticText( m_all_panel, wxID_ANY, wxT("Steps:"), wxDefaultPosition, wxDefaultSize, 0 );
    m_staticText14->Wrap( -1 );
    m_staticText14->SetToolTip( wxT("number of sample steps (default: 20)") );
    sizer0003->Add( m_staticText14, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
    m_steps = new wxSpinCtrl( m_all_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 100, 0 );
    m_steps->SetToolTip( wxT("number of sample steps (default: 20)") );
    sizer0003->Add( m_steps, 0, wxALL, 5 );
    m_staticLine236 = new wxStaticLine( m_all_panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
    sizer0003->Add( m_staticLine236, 0, wxALL|wxEXPAND, 5 );
    m_staticText237 = new wxStaticText( m_all_panel, wxID_ANY, wxT("Width:"), wxDefaultPosition, wxDefaultSize, 0 );
    m_staticText237->Wrap( 0 );
    sizer0003->Add( m_staticText237, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
    m_width = new wxSpinCtrl( m_all_panel, wxID_ANY, wxT("512"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 128, 2048, 512 );
    sizer0003->Add( m_width, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
    m_staticText239 = new wxStaticText( m_all_panel, wxID_ANY, wxT("Height:"), wxDefaultPosition, wxDefaultSize, 0 );
    m_staticText239->Wrap( 0 );
    sizer0003->Add( m_staticText239, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
    m_height = new wxSpinCtrl( m_all_panel, wxID_ANY, wxT("512"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 128, 2048, 512 );
    sizer0003->Add( m_height, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
    m_button7 = new wxButton( m_all_panel, wxID_ANY, wxT("Swap"), wxDefaultPosition, wxDefaultSize, 0 );
    m_button7->SetBitmap( replace_png_to_wx_bitmap() );
    m_button7->SetToolTip( wxT("Swap width and height") );
    sizer0003->Add( m_button7, 0, wxALL, 5 );
    sizer0002->Add( sizer0003, 0, wxALL|wxEXPAND, 5 );
    m_notebook1302 = new wxNotebook( m_all_panel, wxID_ANY, wxDefaultPosition, wxSize( -1,200 ), wxBK_DEFAULT );
    m_notebook1302->SetMinSize( wxSize( -1,200 ) );
    m_jobs_panel = new wxPanel( m_notebook1302, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
    wxBoxSizer* bSizer17;
    bSizer17 = new wxBoxSizer( wxVERTICAL );
    wxBoxSizer* bSizer18;
    bSizer18 = new wxBoxSizer( wxHORIZONTAL );
    m_start_jobs = new wxButton( m_jobs_panel, wxID_ANY, wxT("Start jobs"), wxDefaultPosition, wxDefaultSize, 0 );
    m_start_jobs->SetBitmap( forward_png_to_wx_bitmap() );
    m_start_jobs->Enable( false );
    bSizer18->Add( m_start_jobs, 0, wxALL, 5 );
    m_pause_jobs = new wxButton( m_jobs_panel, wxID_ANY, wxT("Pause"), wxDefaultPosition, wxDefaultSize, 0 );
    m_pause_jobs->SetBitmap( pause_png_to_wx_bitmap() );
    m_pause_jobs->Enable( false );
    bSizer18->Add( m_pause_jobs, 0, wxALL, 5 );
    m_delete_all_jobs = new wxButton( m_jobs_panel, wxID_ANY, wxT("Delete all"), wxDefaultPosition, wxDefaultSize, 0 );
    m_delete_all_jobs->SetBitmap( trash_png_to_wx_bitmap() );
    m_delete_all_jobs->Enable( false );
    bSizer18->Add( m_delete_all_jobs, 0, wxALL, 5 );
    bSizer17->Add( bSizer18, 0, wxEXPAND, 5 );
    m_joblist = new wxDataViewListCtrl( m_jobs_panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
    bSizer17->Add( m_joblist, 1, wxALL|wxEXPAND, 5 );
    m_jobs_panel->SetSizer( bSizer17 );
    m_jobs_panel->Layout();
    bSizer17->Fit( m_jobs_panel );
    m_notebook1302->AddPage( m_jobs_panel, wxT("Jobs and Images"), false );
    m_text2img_panel = new wxPanel( m_notebook1302, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
    wxBoxSizer* sizer0004;
    sizer0004 = new wxBoxSizer( wxHORIZONTAL );
    sizer0004->SetMinSize( wxSize( -1,120 ) );
    m_prompt = new wxTextCtrl( m_text2img_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_WORDWRAP|wxTE_PROCESS_ENTER|wxTE_MULTILINE );
    m_prompt->SetMinSize( wxSize( -1,150 ) );
    sizer0004->Add( m_prompt, 1, wxALL|wxEXPAND, 1 );
    m_neg_prompt = new wxTextCtrl( m_text2img_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_WORDWRAP|wxTE_PROCESS_ENTER|wxTE_MULTILINE );
    m_neg_prompt->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("Arial") ) );
    m_neg_prompt->SetMinSize( wxSize( -1,150 ) );
    sizer0004->Add( m_neg_prompt, 1, wxALL|wxEXPAND, 1 );
    m_text2img_panel->SetSizer( sizer0004 );
    m_text2img_panel->Layout();
    sizer0004->Fit( m_text2img_panel );
    m_notebook1302->AddPage( m_text2img_panel, wxT("Text2IMG"), true );
    m_image2image_panel = new wxPanel( m_notebook1302, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
    m_notebook1302->AddPage( m_image2image_panel, wxT("Image2image"), false );
    m_models_panel = new wxPanel( m_notebook1302, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
    wxBoxSizer* bSizer20;
    bSizer20 = new wxBoxSizer( wxVERTICAL );
    m_data_model_list = new wxDataViewListCtrl( m_models_panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0|wxFULL_REPAINT_ON_RESIZE );
    bSizer20->Add( m_data_model_list, 1, wxALL|wxEXPAND, 5 );
    m_models_panel->SetSizer( bSizer20 );
    m_models_panel->Layout();
    bSizer20->Fit( m_models_panel );
    m_notebook1302->AddPage( m_models_panel, wxT("Models"), false );
    sizer0002->Add( m_notebook1302, 1, wxALIGN_TOP|wxEXPAND, 0 );
    m_staticLine156 = new wxStaticLine( m_all_panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
    sizer0002->Add( m_staticLine156, 0, wxALL|wxEXPAND, 5 );
    wxBoxSizer* bSizer9;
    bSizer9 = new wxBoxSizer( wxHORIZONTAL );
    m_generate = new wxButton( m_all_panel, wxID_ANY, wxT("Queue"), wxDefaultPosition, wxDefaultSize, 0 );
    m_generate->SetBitmap( play_png_to_wx_bitmap() );
    m_generate->Enable( false );
    bSizer9->Add( m_generate, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
    m_staticText15 = new wxStaticText( m_all_panel, wxID_ANY, wxT("Batch:"), wxDefaultPosition, wxDefaultSize, 0 );
    m_staticText15->Wrap( -1 );
    m_staticText15->SetToolTip( wxT("number of images to generate.") );
    bSizer9->Add( m_staticText15, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
    m_batch_count = new wxSpinCtrl( m_all_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 10, 0 );
    m_batch_count->SetToolTip( wxT("number of images to generate.") );
    bSizer9->Add( m_batch_count, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
    m_staticline5 = new wxStaticLine( m_all_panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
    bSizer9->Add( m_staticline5, 0, wxEXPAND | wxALL, 5 );
    m_staticText17 = new wxStaticText( m_all_panel, wxID_ANY, wxT("Presets:"), wxDefaultPosition, wxDefaultSize, 0 );
    m_staticText17->Wrap( -1 );
    bSizer9->Add( m_staticText17, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
    m_save_preset = new wxButton( m_all_panel, wxID_ANY, wxT("Save"), wxDefaultPosition, wxDefaultSize, 0 );
    m_save_preset->SetBitmap( disk_png_to_wx_bitmap() );
    bSizer9->Add( m_save_preset, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
    m_load_preset = new wxButton( m_all_panel, wxID_ANY, wxT("Load"), wxDefaultPosition, wxDefaultSize, 0 );
    m_load_preset->SetBitmap( file_import_png_to_wx_bitmap() );
    m_load_preset->Enable( false );
    bSizer9->Add( m_load_preset, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
    wxArrayString m_preset_listChoices;
    m_preset_list = new wxChoice( m_all_panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_preset_listChoices, 0 );
    m_preset_list->SetSelection( 0 );
    m_preset_list->Enable( false );
    bSizer9->Add( m_preset_list, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
    m_delete_preset = new wxButton( m_all_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 24,24 ), 0 );
    m_delete_preset->SetBitmap( trash_png_to_wx_bitmap() );
    m_delete_preset->Enable( false );
    bSizer9->Add( m_delete_preset, 0, wxALL, 5 );
    sizer0002->Add( bSizer9, 0, wxEXPAND, 5 );
    logs = new wxTextCtrl( m_all_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_WORDWRAP|wxTE_READONLY|wxTE_MULTILINE|wxTE_AUTO_URL|wxFULL_REPAINT_ON_RESIZE );
    logs->SetMinSize( wxSize( -1,100 ) );
    sizer0002->Add( logs, 0, wxALL|wxEXPAND, 5 );
    m_all_panel->SetSizer( sizer0002 );
    m_all_panel->Layout();
    sizer0002->Fit( m_all_panel );
    sizer0001->Add( m_all_panel, 1, wxEXPAND, 5 );
    this->SetSizer( sizer0001 );
    this->Layout();
    m_statusBar166 = this->CreateStatusBar( 1, wxSTB_DEFAULT_STYLE, wxID_ANY );
    this->Centre( wxBOTH );
    // Connect Events
    m_settings->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( UI::onSettings ), NULL, this );
    m_refresh->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( UI::onModelsRefresh ), NULL, this );
    m_model->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( UI::onModelSelect ), NULL, this );
    m_vae->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( UI::onVaeSelect ), NULL, this );
    m_sampler->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( UI::onSamplerSelect ), NULL, this );
    m_button7->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( UI::onResolutionSwap ), NULL, this );
    m_start_jobs->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( UI::onJobsStart ), NULL, this );
    m_pause_jobs->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( UI::onJobsPause ), NULL, this );
    m_delete_all_jobs->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( UI::onJobsDelete ), NULL, this );
    m_joblist->Connect( wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, wxDataViewEventHandler( UI::onJoblistItemActivated ), NULL, this );
    m_joblist->Connect( wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler( UI::onJoblistSelectionChanged ), NULL, this );
    m_generate->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( UI::onGenerate ), NULL, this );
    m_save_preset->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( UI::onSavePreset ), NULL, this );
    m_load_preset->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( UI::onLoadPreset ), NULL, this );
    m_preset_list->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( UI::onSelectPreset ), NULL, this );
    m_delete_preset->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( UI::onDeletePreset ), NULL, this );
}
UI::~UI()
{
    // Disconnect Events
    m_settings->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( UI::onSettings ), NULL, this );
    m_refresh->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( UI::onModelsRefresh ), NULL, this );
    m_model->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( UI::onModelSelect ), NULL, this );
    m_vae->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( UI::onVaeSelect ), NULL, this );
    m_sampler->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( UI::onSamplerSelect ), NULL, this );
    m_button7->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( UI::onResolutionSwap ), NULL, this );
    m_start_jobs->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( UI::onJobsStart ), NULL, this );
    m_pause_jobs->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( UI::onJobsPause ), NULL, this );
    m_delete_all_jobs->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( UI::onJobsDelete ), NULL, this );
    m_joblist->Disconnect( wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, wxDataViewEventHandler( UI::onJoblistItemActivated ), NULL, this );
    m_joblist->Disconnect( wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler( UI::onJoblistSelectionChanged ), NULL, this );
    m_generate->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( UI::onGenerate ), NULL, this );
    m_save_preset->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( UI::onSavePreset ), NULL, this );
    m_load_preset->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( UI::onLoadPreset ), NULL, this );
    m_preset_list->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( UI::onSelectPreset ), NULL, this );
    m_delete_preset->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( UI::onDeletePreset ), NULL, this );
}
Settings::Settings( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
    this->SetSizeHints( wxDefaultSize, wxDefaultSize );
    wxBoxSizer* sizer2010;
    sizer2010 = new wxBoxSizer( wxVERTICAL );
    m_notebook1696 = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBK_DEFAULT );
    m_path_panel = new wxPanel( m_notebook1696, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
    wxBoxSizer* sizer2011;
    sizer2011 = new wxBoxSizer( wxVERTICAL );
    wxGridSizer* sizer2012;
    sizer2012 = new wxGridSizer( 0, 2, 0, 0 );
    m_staticText172410 = new wxStaticText( m_path_panel, wxID_ANY, wxT("Models path"), wxDefaultPosition, wxDefaultSize, 0 );
    m_staticText172410->Wrap( 0 );
    sizer2012->Add( m_staticText172410, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
    m_model_dir = new wxDirPickerCtrl( m_path_panel, wxID_ANY, wxEmptyString, wxT("Select a folder"), wxDefaultPosition, wxDefaultSize, wxDIRP_SMALL|wxDIRP_DEFAULT_STYLE );
    m_model_dir->SetMinSize( wxSize( 200,-1 ) );
    sizer2012->Add( m_model_dir, 0, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
    sizer2011->Add( sizer2012, 0, wxEXPAND, 5 );
    wxGridSizer* sizer2013;
    sizer2013 = new wxGridSizer( 0, 2, 0, 0 );
    m_staticText18013 = new wxStaticText( m_path_panel, wxID_ANY, wxT("Vae path"), wxDefaultPosition, wxDefaultSize, 0 );
    m_staticText18013->Wrap( 0 );
    sizer2013->Add( m_staticText18013, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
    m_vae_dir = new wxDirPickerCtrl( m_path_panel, wxID_ANY, wxEmptyString, wxT("Select a folder"), wxDefaultPosition, wxDefaultSize, wxDIRP_SMALL|wxDIRP_DEFAULT_STYLE );
    m_vae_dir->SetMinSize( wxSize( 200,-1 ) );
    sizer2013->Add( m_vae_dir, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
    sizer2011->Add( sizer2013, 0, wxEXPAND, 5 );
    wxGridSizer* sizer2014;
    sizer2014 = new wxGridSizer( 0, 2, 0, 0 );
    m_staticText1801317202731 = new wxStaticText( m_path_panel, wxID_ANY, wxT("Embedding path"), wxDefaultPosition, wxDefaultSize, 0 );
    m_staticText1801317202731->Wrap( 0 );
    sizer2014->Add( m_staticText1801317202731, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
    m_embedding_dir = new wxDirPickerCtrl( m_path_panel, wxID_ANY, wxEmptyString, wxT("Select a folder"), wxDefaultPosition, wxDefaultSize, wxDIRP_SMALL|wxDIRP_DEFAULT_STYLE );
    m_embedding_dir->SetMinSize( wxSize( 200,-1 ) );
    sizer2014->Add( m_embedding_dir, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
    sizer2011->Add( sizer2014, 0, wxEXPAND, 5 );
    wxGridSizer* sizer2015;
    sizer2015 = new wxGridSizer( 0, 2, 0, 0 );
    m_staticText18013172027 = new wxStaticText( m_path_panel, wxID_ANY, wxT("Lora path"), wxDefaultPosition, wxDefaultSize, 0 );
    m_staticText18013172027->Wrap( 0 );
    sizer2015->Add( m_staticText18013172027, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
    m_lora_dir = new wxDirPickerCtrl( m_path_panel, wxID_ANY, wxEmptyString, wxT("Select a folder"), wxDefaultPosition, wxDefaultSize, wxDIRP_SMALL|wxDIRP_DEFAULT_STYLE );
    m_lora_dir->SetMinSize( wxSize( 200,-1 ) );
    sizer2015->Add( m_lora_dir, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
    sizer2011->Add( sizer2015, 0, wxEXPAND, 5 );
    wxGridSizer* gSizer8;
    gSizer8 = new wxGridSizer( 0, 2, 0, 0 );
    m_staticText19 = new wxStaticText( m_path_panel, wxID_ANY, wxT("Presets path"), wxDefaultPosition, wxDefaultSize, 0 );
    m_staticText19->Wrap( -1 );
    gSizer8->Add( m_staticText19, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
    m_presets_dir = new wxDirPickerCtrl( m_path_panel, wxID_ANY, wxEmptyString, wxT("Select a folder"), wxDefaultPosition, wxDefaultSize, wxDIRP_DEFAULT_STYLE|wxDIRP_SMALL );
    m_presets_dir->SetMinSize( wxSize( 200,-1 ) );
    gSizer8->Add( m_presets_dir, 0, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
    sizer2011->Add( gSizer8, 0, wxEXPAND, 5 );
    m_staticLine223 = new wxStaticLine( m_path_panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
    sizer2011->Add( m_staticLine223, 0, wxALL|wxEXPAND, 5 );
    wxGridSizer* sizer2016;
    sizer2016 = new wxGridSizer( 0, 2, 0, 0 );
    m_staticText180131720 = new wxStaticText( m_path_panel, wxID_ANY, wxT("Images output"), wxDefaultPosition, wxDefaultSize, 0 );
    m_staticText180131720->Wrap( 0 );
    sizer2016->Add( m_staticText180131720, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
    m_images_output = new wxDirPickerCtrl( m_path_panel, wxID_ANY, wxEmptyString, wxT("Select a folder"), wxDefaultPosition, wxDefaultSize, wxDIRP_SMALL|wxDIRP_DEFAULT_STYLE );
    m_images_output->SetMinSize( wxSize( 200,-1 ) );
    sizer2016->Add( m_images_output, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
    sizer2011->Add( sizer2016, 0, wxEXPAND, 5 );
    m_path_panel->SetSizer( sizer2011 );
    m_path_panel->Layout();
    sizer2011->Fit( m_path_panel );
    m_notebook1696->AddPage( m_path_panel, wxT("Paths"), false );
    m_settings = new wxPanel( m_notebook1696, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
    wxBoxSizer* sizer2017;
    sizer2017 = new wxBoxSizer( wxVERTICAL );
    wxGridSizer* sizer2018;
    sizer2018 = new wxGridSizer( 0, 2, 0, 0 );
    m_keep_model_in_memory = new wxCheckBox( m_settings, wxID_ANY, wxT("Keep model in memory"), wxDefaultPosition, wxDefaultSize, 0 );
    m_keep_model_in_memory->SetValue(true);
    sizer2018->Add( m_keep_model_in_memory, 0, wxALIGN_LEFT|wxALL, 5 );
    sizer2017->Add( sizer2018, 0, wxALL|wxEXPAND, 5 );
    wxGridSizer* sizer2019;
    sizer2019 = new wxGridSizer( 0, 2, 0, 0 );
    m_save_all_image = new wxCheckBox( m_settings, wxID_ANY, wxT("Save all images (intermediat images)"), wxDefaultPosition, wxDefaultSize, 0 );
    m_save_all_image->SetValue(true);
    sizer2019->Add( m_save_all_image, 0, wxALIGN_LEFT|wxALL, 5 );
    sizer2017->Add( sizer2019, 0, wxALL|wxEXPAND, 5 );
    wxBoxSizer* bSizer10;
    bSizer10 = new wxBoxSizer( wxHORIZONTAL );
    m_staticText16 = new wxStaticText( m_settings, wxID_ANY, wxT("Output images type"), wxDefaultPosition, wxDefaultSize, 0 );
    m_staticText16->Wrap( -1 );
    bSizer10->Add( m_staticText16, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
    wxString m_choice4Choices[] = { wxT(".png"), wxT(".jpg") };
    int m_choice4NChoices = sizeof( m_choice4Choices ) / sizeof( wxString );
    m_choice4 = new wxChoice( m_settings, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choice4NChoices, m_choice4Choices, 0 );
    m_choice4->SetSelection( 0 );
    bSizer10->Add( m_choice4, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
    sizer2017->Add( bSizer10, 0, wxEXPAND, 5 );
    m_settings->SetSizer( sizer2017 );
    m_settings->Layout();
    sizer2017->Fit( m_settings );
    m_notebook1696->AddPage( m_settings, wxT("Diffusion"), false );
    sizer2010->Add( m_notebook1696, 1, wxALL|wxEXPAND, 5 );
    m_save = new wxButton( this, wxID_ANY, wxT("Save"), wxDefaultPosition, wxDefaultSize, 0 );
    m_save->SetBitmap( disk_png_to_wx_bitmap() );
    sizer2010->Add( m_save, 0, wxALL, 5 );
    this->SetSizer( sizer2010 );
    this->Layout();
    this->Centre( wxBOTH );
    // Connect Events
    m_save->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( Settings::onSave ), NULL, this );
}
Settings::~Settings()
{
    // Disconnect Events
    m_save->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( Settings::onSave ), NULL, this );
}
ImageViewer::ImageViewer( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
    this->SetSizeHints( wxSize( 512,512 ), wxDefaultSize );
    wxBoxSizer* ImageViewerbSizer11;
    ImageViewerbSizer11 = new wxBoxSizer( wxHORIZONTAL );
    m_bitmap = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
    m_bitmap->SetMinSize( wxSize( 512,512 ) );
    ImageViewerbSizer11->Add( m_bitmap, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
    m_textCtrl4 = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,80 ), wxTE_MULTILINE|wxTE_READONLY|wxTE_WORDWRAP );
    m_textCtrl4->SetMinSize( wxSize( -1,80 ) );
    ImageViewerbSizer11->Add( m_textCtrl4, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 );
    this->SetSizer( ImageViewerbSizer11 );
    this->Layout();
    this->Centre( wxBOTH );
}
ImageViewer::~ImageViewer()
{
}
ui/MainWindow.h
New file
@@ -0,0 +1,182 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#pragma once
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/button.h>
#include <wx/string.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/stattext.h>
#include <wx/choice.h>
#include <wx/sizer.h>
#include <wx/spinctrl.h>
#include <wx/statline.h>
#include <wx/dataview.h>
#include <wx/panel.h>
#include <wx/textctrl.h>
#include <wx/notebook.h>
#include <wx/statusbr.h>
#include <wx/frame.h>
#include <wx/filepicker.h>
#include <wx/checkbox.h>
#include <wx/statbmp.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class UI
///////////////////////////////////////////////////////////////////////////////
class UI : public wxFrame
{
    private:
    protected:
        wxPanel* m_all_panel;
        wxButton* m_settings;
        wxButton* m_refresh;
        wxStaticText* m_staticText160;
        wxChoice* m_model;
        wxStaticText* m_staticText161;
        wxChoice* m_vae;
        wxStaticText* m_staticText163;
        wxChoice* m_sampler;
        wxStaticText* m_staticText231;
        wxSpinCtrlDouble* m_cfg;
        wxStaticText* m_staticText233;
        wxSpinCtrl* m_seed;
        wxStaticText* m_staticText234;
        wxSpinCtrl* m_clip_skip;
        wxStaticText* m_staticText14;
        wxSpinCtrl* m_steps;
        wxStaticLine* m_staticLine236;
        wxStaticText* m_staticText237;
        wxSpinCtrl* m_width;
        wxStaticText* m_staticText239;
        wxSpinCtrl* m_height;
        wxButton* m_button7;
        wxNotebook* m_notebook1302;
        wxPanel* m_jobs_panel;
        wxButton* m_start_jobs;
        wxButton* m_pause_jobs;
        wxButton* m_delete_all_jobs;
        wxDataViewListCtrl* m_joblist;
        wxPanel* m_text2img_panel;
        wxTextCtrl* m_prompt;
        wxTextCtrl* m_neg_prompt;
        wxPanel* m_image2image_panel;
        wxPanel* m_models_panel;
        wxDataViewListCtrl* m_data_model_list;
        wxStaticLine* m_staticLine156;
        wxButton* m_generate;
        wxStaticText* m_staticText15;
        wxSpinCtrl* m_batch_count;
        wxStaticLine* m_staticline5;
        wxStaticText* m_staticText17;
        wxButton* m_save_preset;
        wxButton* m_load_preset;
        wxChoice* m_preset_list;
        wxButton* m_delete_preset;
        wxTextCtrl* logs;
        wxStatusBar* m_statusBar166;
        // Virtual event handlers, override them in your derived class
        virtual void onSettings( wxCommandEvent& event ) { event.Skip(); }
        virtual void onModelsRefresh( wxCommandEvent& event ) { event.Skip(); }
        virtual void onModelSelect( wxCommandEvent& event ) { event.Skip(); }
        virtual void onVaeSelect( wxCommandEvent& event ) { event.Skip(); }
        virtual void onSamplerSelect( wxCommandEvent& event ) { event.Skip(); }
        virtual void onResolutionSwap( wxCommandEvent& event ) { event.Skip(); }
        virtual void onJobsStart( wxCommandEvent& event ) { event.Skip(); }
        virtual void onJobsPause( wxCommandEvent& event ) { event.Skip(); }
        virtual void onJobsDelete( wxCommandEvent& event ) { event.Skip(); }
        virtual void onJoblistItemActivated( wxDataViewEvent& event ) { event.Skip(); }
        virtual void onJoblistSelectionChanged( wxDataViewEvent& event ) { event.Skip(); }
        virtual void onGenerate( wxCommandEvent& event ) { event.Skip(); }
        virtual void onSavePreset( wxCommandEvent& event ) { event.Skip(); }
        virtual void onLoadPreset( wxCommandEvent& event ) { event.Skip(); }
        virtual void onSelectPreset( wxCommandEvent& event ) { event.Skip(); }
        virtual void onDeletePreset( wxCommandEvent& event ) { event.Skip(); }
    public:
        UI( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("sd.cpp.gui"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 800,600 ), long style = wxCAPTION|wxCLOSE_BOX|wxICONIZE|wxMINIMIZE_BOX|wxSYSTEM_MENU|wxBORDER_THEME|wxCLIP_CHILDREN );
        ~UI();
};
///////////////////////////////////////////////////////////////////////////////
/// Class Settings
///////////////////////////////////////////////////////////////////////////////
class Settings : public wxFrame
{
    private:
    protected:
        wxNotebook* m_notebook1696;
        wxPanel* m_path_panel;
        wxStaticText* m_staticText172410;
        wxDirPickerCtrl* m_model_dir;
        wxStaticText* m_staticText18013;
        wxDirPickerCtrl* m_vae_dir;
        wxStaticText* m_staticText1801317202731;
        wxDirPickerCtrl* m_embedding_dir;
        wxStaticText* m_staticText18013172027;
        wxDirPickerCtrl* m_lora_dir;
        wxStaticText* m_staticText19;
        wxDirPickerCtrl* m_presets_dir;
        wxStaticLine* m_staticLine223;
        wxStaticText* m_staticText180131720;
        wxDirPickerCtrl* m_images_output;
        wxPanel* m_settings;
        wxCheckBox* m_keep_model_in_memory;
        wxCheckBox* m_save_all_image;
        wxStaticText* m_staticText16;
        wxChoice* m_choice4;
        wxButton* m_save;
        // Virtual event handlers, override them in your derived class
        virtual void onSave( wxCommandEvent& event ) { event.Skip(); }
    public:
        Settings( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 600,400 ), long style = wxFRAME_NO_TASKBAR|wxFRAME_FLOAT_ON_PARENT|wxCAPTION|wxCLOSE_BOX|wxFULL_REPAINT_ON_RESIZE|wxTAB_TRAVERSAL|wxBORDER_THEME );
        ~Settings();
};
///////////////////////////////////////////////////////////////////////////////
/// Class ImageViewer
///////////////////////////////////////////////////////////////////////////////
class ImageViewer : public wxFrame
{
    private:
    protected:
    public:
        wxStaticBitmap* m_bitmap;
        wxTextCtrl* m_textCtrl4;
        ImageViewer( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 800,600 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL );
        ~ImageViewer();
};
ui/MainWindowImageViewer.cpp
New file
@@ -0,0 +1,8 @@
#include "MainWindowImageViewer.h"
MainWindowImageViewer::MainWindowImageViewer( wxWindow* parent )
:
ImageViewer( parent )
{
}
ui/MainWindowImageViewer.h
New file
@@ -0,0 +1,39 @@
#ifndef __MainWindowImageViewer__
#define __MainWindowImageViewer__
/**
@file
Subclass of ImageViewer, which is generated by wxFormBuilder.
*/
#include "MainWindow.h"
//// end generated include
/** Implementing ImageViewer */
class MainWindowImageViewer : public ImageViewer
{
    public:
        /** Constructor */
        MainWindowImageViewer( wxWindow* parent );
    //// end generated class members
};
#endif // __MainWindowImageViewer__
ui/MainWindowSettings.cpp
New file
@@ -0,0 +1,73 @@
#include "MainWindowSettings.h"
MainWindowSettings::MainWindowSettings( wxWindow* parent )
:
Settings( parent )
{
    this->ini_path = wxStandardPaths::Get().GetUserConfigDir() + wxFileName::GetPathSeparator() + "sd.ui.config.ini";
    this->cfg = new sd_gui_utils::config;
    this->fileConfig = new wxFileConfig("sd.cpp.ui", wxEmptyString, this->ini_path);
    wxConfigBase::Set(fileConfig);
    this->InitConfig();
}
void MainWindowSettings::onSave( wxCommandEvent& event )
{
this->fileConfig->Write("/paths/lora", this->m_lora_dir->GetPath());
this->fileConfig->Write("/paths/model", this->m_model_dir->GetPath());
this->fileConfig->Write("/paths/vae", this->m_vae_dir->GetPath());
this->fileConfig->Write("/paths/embedding", this->m_embedding_dir->GetPath());
this->fileConfig->Write("/paths/presets", this->m_presets_dir->GetPath());
this->fileConfig->Write("/keep_model_in_memory", this->m_keep_model_in_memory->GetValue());
this->fileConfig->Write("/save_all_image", this->m_save_all_image->GetValue());
this->fileConfig->Flush();
this->Close();
}
void MainWindowSettings::InitConfig()
{
    wxString datapath = wxStandardPaths::Get().GetUserDataDir() + wxFileName::GetPathSeparator() + "sd_ui_data" + wxFileName::GetPathSeparator();
    wxString imagespath = wxStandardPaths::Get().GetDocumentsDir() + wxFileName::GetPathSeparator() + "sd_ui_output" + wxFileName::GetPathSeparator();
    wxString model_path = datapath;
    model_path.append("checkpoints");
    wxString vae_path = datapath;
    vae_path.append("vae");
    wxString lora_path = datapath;
    lora_path.append("lora");
    wxString embedding_path = datapath;
    embedding_path.append("embedding");
    wxString presets_path = datapath;
    presets_path.append("presets");
    this->cfg->lora = this->fileConfig->Read("/paths/lora", lora_path).ToStdString();
    this->cfg->model = this->fileConfig->Read("/paths/model", model_path).ToStdString();
    this->cfg->vae = this->fileConfig->Read("/paths/vae", vae_path).ToStdString();
    this->cfg->embedding = this->fileConfig->Read("/paths/embedding", embedding_path).ToStdString();
    this->cfg->presets = this->fileConfig->Read("/paths/presets", presets_path).ToStdString();
    this->cfg->output = this->fileConfig->Read("/paths/output", imagespath).ToStdString();
    this->cfg->keep_model_in_memory = this->fileConfig->Read("/keep_model_in_memory", this->cfg->keep_model_in_memory);
    this->cfg->save_all_image = this->fileConfig->Read("/save_all_image", this->cfg->save_all_image);
    this->m_lora_dir->SetPath(this->cfg->lora);
    this->m_model_dir->SetPath(this->cfg->model);
    this->m_vae_dir->SetPath(this->cfg->vae);
    this->m_embedding_dir->SetPath(this->cfg->embedding);
    this->m_presets_dir->SetPath(this->cfg->presets);
    this->m_images_output->SetPath(this->cfg->output);
    this->m_keep_model_in_memory->SetValue(this->cfg->keep_model_in_memory);
    this->m_save_all_image->SetValue(this->cfg->save_all_image);
    // hide unusable configs...
    if (SD_CPP_VERSION == "c6071fa")
    {
        this->m_embedding_dir->Hide();
        this->m_staticText18013172027->Hide();
    }
}
ui/MainWindowSettings.h
New file
@@ -0,0 +1,65 @@
#ifndef __MainWindowSettings__
#define __MainWindowSettings__
/**
@file
Subclass of Settings, which is generated by wxFormBuilder.
*/
#include "MainWindow.h"
//// end generated include
#include "ver.hpp"
#include "utils.hpp"
#include <wx/fileconf.h>
#include <wx/stdpaths.h>
/** Implementing Settings */
class MainWindowSettings : public Settings
{
    protected:
        // Handlers for Settings events.
        void onSave( wxCommandEvent& event );
    public:
        /** Constructor */
        MainWindowSettings( wxWindow* parent );
    //// end generated class members
private:
    void InitConfig();
    wxFileConfig *fileConfig;
    sd_gui_utils::config *cfg;
    std::string ini_path;
};
#endif // __MainWindowSettings__
ui/MainWindowUI.cpp
New file
@@ -0,0 +1,875 @@
#include "MainWindowUI.h"
MainWindowUI::MainWindowUI(wxWindow *parent)
    : UI(parent)
{
    this->ini_path = wxStandardPaths::Get().GetUserConfigDir() + wxFileName::GetPathSeparator() + "sd.ui.config.ini";
    this->sd_params = new sd_gui_utils::SDParams;
    this->notification = new wxNotificationMessage();
    this->notification->SetParent(this);
    // prepare data list views
    this->m_data_model_list->AppendTextColumn("Name", wxDATAVIEW_CELL_INERT, 200);
    this->m_data_model_list->AppendTextColumn("Size");
    this->m_joblist->AppendTextColumn("Id");
    this->m_joblist->AppendTextColumn("Created");
    this->m_joblist->AppendTextColumn("Update");
    this->m_joblist->AppendTextColumn("Status");
    this->SetTitle(this->GetTitle() + SD_GUI_VERSION);
    this->cfg = new sd_gui_utils::config;
    this->fileConfig = new wxFileConfig("sd.cpp.ui", wxEmptyString, this->ini_path);
    wxConfigBase::Set(fileConfig);
    this->initConfig();
    this->qmanager = new QM::QueueManager(this->GetEventHandler(), this->cfg->jobs);
    // set SD logger
    sd_set_log_callback(MainWindowUI::HandleSDLog, (void *)this);
    // load
    this->LoadPresets();
    this->loadModelList();
    this->loadVaeList();
    if (this->ModelFiles.size() > 0)
    {
        this->m_model->Enable();
    }
    if (this->VaeFiles.size() > 0)
    {
        this->m_vae->Enable();
    }
    Bind(wxEVT_THREAD, &MainWindowUI::OnThreadMessage, this);
}
void MainWindowUI::onSettings(wxCommandEvent &event)
{
    this->settingsWindow = new MainWindowSettings(this);
    this->settingsWindow->Bind(wxEVT_CLOSE_WINDOW, &MainWindowUI::OnCloseSettings, this);
    settingsWindow->Show();
}
void MainWindowUI::onModelsRefresh(wxCommandEvent &event)
{
    this->loadModelList();
    this->loadVaeList();
    if (this->ModelFiles.size() > 0)
    {
        this->m_model->Enable();
    }
    if (this->VaeFiles.size() > 0)
    {
        this->m_vae->Enable();
    }
}
void MainWindowUI::onModelSelect(wxCommandEvent &event)
{
    // check if really selected a model, or just the first element, which is always exists...
    auto name = this->m_model->GetStringSelection().ToStdString();
    auto first = this->m_model->GetString(0);
    if (name == first)
    {
        this->m_generate->Disable();
        this->m_statusBar166->SetStatusText("Model: none");
        return;
    }
    this->m_generate->Enable();
    this->sd_params->model_path = this->ModelFiles.at(name);
    this->m_statusBar166->SetStatusText("Model: " + this->sd_params->model_path);
    // add the model to the params, but dont start load the model...
    // the queue handle it...
    // this->StartLoadModel();
}
void MainWindowUI::onVaeSelect(wxCommandEvent &event)
{
    auto selection = this->m_vae->GetStringSelection();
    if (selection == "-none-")
    {
        // remove the vae
        this->sd_params->vae_path = std::string("");
    }
    else
    {
        // add the selected vae
        this->sd_params->vae_path = this->VaeFiles.at(selection.ToStdString());
    }
    // just select the vae file and add the live paramaeters, do not load the model, just add job to the queu on press the queue button
    /*  if (this->m_generate->IsEnabled() == true)
    {
    wxPostEvent(this->m_model, event);
    }
    */
}
void MainWindowUI::onSamplerSelect(wxCommandEvent &event)
{
    this->sd_params->sample_method = (sample_method_t)this->m_sampler->GetSelection();
}
void MainWindowUI::onResolutionSwap(wxCommandEvent &event)
{
    auto oldW = this->m_width->GetValue();
    auto oldH = this->m_height->GetValue();
    this->m_height->SetValue(oldW);
    this->m_width->SetValue(oldH);
}
void MainWindowUI::onJobsStart(wxCommandEvent &event)
{
    // TODO: Implement onJobsStart
}
void MainWindowUI::onJobsPause(wxCommandEvent &event)
{
    // TODO: Implement onJobsPause
}
void MainWindowUI::onJobsDelete(wxCommandEvent &event)
{
    // TODO: Implement onJobsDelete
}
void MainWindowUI::onJoblistItemActivated(wxDataViewEvent &event)
{
    // TODO: Implement onJoblistItemActivated
}
void MainWindowUI::onJoblistSelectionChanged(wxDataViewEvent &event)
{
    // TODO: Implement onJoblistSelectionChanged
}
void MainWindowUI::onGenerate(wxCommandEvent &event)
{
    // this->StartGeneration();
    //  dont start the generation, just add the job to the queue, to handle it the queue manager
    //  so it will possible to add more job afterall
    this->qmanager->AddItem(this->sd_params);
}
void MainWindowUI::onSavePreset(wxCommandEvent &event)
{
    wxTextEntryDialog dlg(this, "Please specify a name (only alphanumeric)");
    dlg.SetTextValidator(wxFILTER_ALPHA | wxFILTER_DIGITS);
    if (dlg.ShowModal() == wxID_OK)
    {
        sd_gui_utils::generator_preset preset;
        wxString preset_name = dlg.GetValue();
        preset.cfg = this->m_cfg->GetValue();
        preset.seed = this->m_seed->GetValue();
        preset.clip_skip = this->m_clip_skip->GetValue();
        preset.steps = this->m_steps->GetValue();
        preset.width = this->m_width->GetValue();
        preset.height = this->m_height->GetValue();
        preset.sampler = (sample_method_t)this->m_sampler->GetSelection();
        preset.batch = this->m_batch_count->GetValue();
        preset.name = preset_name.ToStdString();
        preset.mode = "text2image";
        nlohmann::json j(preset);
        std::string presetfile = fmt::format("{}{}{}.json",
                                             this->cfg->presets,
                                             wxString(wxFileName::GetPathSeparator()).ToStdString(),
                                             preset.name);
        std::ofstream file(presetfile);
        file << j;
        file.close();
        this->LoadPresets();
    }
}
void MainWindowUI::onLoadPreset(wxCommandEvent &event)
{
    /* auto preset_name = this->m_preset_list->GetString(this->m_preset_list->GetCurrentSelection());
    this->m_cfg->SetValue(this->fileConfig->Read("/presets/" + preset_name + "/cfg", this->sd_params->cfg_scale));
    this->m_seed->SetValue(this->fileConfig->Read("/presets/" + preset_name + "/seed", this->sd_params->seed));
    this->m_clip_skip->SetValue(this->fileConfig->Read("/presets/" + preset_name + "/clip_skip", this->sd_params->clip_skip));
    this->m_steps->SetValue(this->fileConfig->Read("/presets/" + preset_name + "/steps", this->sd_params->sample_steps));
    this->m_width->SetValue(this->fileConfig->Read("/presets/" + preset_name + "/width", this->sd_params->width));
    this->m_height->SetValue(this->fileConfig->Read("/presets/" + preset_name + "/height", this->sd_params->height));
    this->m_sampler->Select(this->fileConfig->Read("/presets/" + preset_name + "/sampler", (int)this->sd_params->sample_method));
    this->m_batch_count->SetValue(this->fileConfig->Read("/presets/" + preset_name + "/batch", this->sd_params->batch_count));
    */
    auto selected = this->m_preset_list->GetCurrentSelection();
    auto name = this->m_preset_list->GetString(selected);
    for (auto preset : this->Presets)
    {
        if (preset.second.name == name)
        {
            this->m_cfg->SetValue(preset.second.cfg);
            this->m_clip_skip->SetValue(preset.second.clip_skip);
            this->m_seed->SetValue(preset.second.seed);
            this->m_steps->SetValue(preset.second.steps);
            this->m_width->SetValue(preset.second.width);
            this->m_height->SetValue(preset.second.height);
            this->m_sampler->SetSelection(preset.second.sampler);
            this->m_batch_count->SetValue(preset.second.batch);
        }
    }
}
void MainWindowUI::onSelectPreset(wxCommandEvent &event)
{
    if (this->m_preset_list->GetCurrentSelection() == 0)
    {
        this->m_load_preset->Disable();
        this->m_delete_preset->Disable();
    }
    else
    {
        this->m_load_preset->Enable();
        this->m_delete_preset->Enable();
    }
}
void MainWindowUI::onDeletePreset(wxCommandEvent &event)
{
    auto name = this->m_preset_list->GetStringSelection().ToStdString();
    if (this->Presets.find(name) != this->Presets.end())
    {
        auto preset = this->Presets[name];
        std::remove(preset.path.c_str());
        this->LoadPresets();
    }
}
void MainWindowUI::OnQueueItemManagerItemAdded(QM::QueueItem item)
{
    wxVector<wxVariant> data;
    data.push_back(wxVariant(item.id));
    data.push_back(wxVariant(item.created_at));
    data.push_back(wxVariant(item.updated_at));
    data.push_back(wxVariant(QM::QueueStatus_str[item.status]));
    this->m_joblist->AppendItem(data);
    /*
    for (auto model : this->ModelFiles)
    {
        // auto size = sd_gui_utils::HumanReadable{std::filesystem::file_size(model.second)};
        auto size = std::filesystem::file_size(model.second);
        wxVector<wxVariant> data;
        data.push_back(wxVariant(model.first));
        data.push_back(wxVariant(std::to_string(size)));
        this->m_data_model_list->AppendItem(data);
    }
    this->m_data_model_list->Refresh();*/
}
void MainWindowUI::LoadFileList(sd_gui_utils::DirTypes type)
{
    std::string basepath;
    switch (type)
    {
    case sd_gui_utils::DirTypes::VAE:
        this->VaeFiles.clear();
        this->m_vae->Clear();
        this->m_vae->Append("-none-");
        this->m_vae->Select(0);
        basepath = this->cfg->vae;
        break;
    case sd_gui_utils::DirTypes::LORA:
        basepath = this->cfg->lora;
        break;
    case sd_gui_utils::DirTypes::CHECKPOINT:
        this->ModelFiles.clear();
        this->m_model->Clear();
        this->m_model->Append("-none-");
        this->m_model->Select(0);
        basepath = this->cfg->model;
        break;
    case sd_gui_utils::DirTypes::PRESETS:
        this->Presets.clear();
        this->m_preset_list->Clear();
        this->m_preset_list->Append("-none-");
        this->m_preset_list->Select(0);
        basepath = this->cfg->presets;
        break;
    }
    if (!std::filesystem::exists(basepath))
    {
        std::filesystem::create_directories(basepath);
    }
    int i = 0;
    for (auto const &dir_entry : std::filesystem::recursive_directory_iterator(basepath))
    {
        if (!dir_entry.exists() || !dir_entry.is_regular_file() || !dir_entry.path().has_extension())
        {
            continue;
        }
        std::filesystem::path path = dir_entry.path();
        std::string ext = path.extension().string();
        if (type == sd_gui_utils::DirTypes::CHECKPOINT || type == sd_gui_utils::DirTypes::VAE)
        {
            if (ext != ".safetensors" && ext != ".cptk")
            {
                continue;
            }
        }
        if (type == sd_gui_utils::DirTypes::PRESETS)
        {
            if (ext != ".json")
            {
                continue;
            }
        }
        std::string name = path.filename().replace_extension("").string();
        // prepend the subdirectory to the modelname
        // // wxFileName::GetPathSeparator()
        auto path_name = path.string();
        sd_gui_utils::replace(path_name, basepath, "");
        sd_gui_utils::replace(path_name, "//", "");
        sd_gui_utils::replace(path_name, "\\\\", "");
        sd_gui_utils::replace(path_name, ext, "");
        name = path_name.substr(1);
        if (type == sd_gui_utils::CHECKPOINT)
        {
            this->m_model->Append(name);
            this->ModelFiles.emplace(name, dir_entry.path().string());
        }
        if (type == sd_gui_utils::VAE)
        {
            this->m_vae->Append(name);
            this->VaeFiles.emplace(name, dir_entry.path().string());
        }
        if (type == sd_gui_utils::PRESETS)
        {
            sd_gui_utils::generator_preset preset;
            std::ifstream f(path.string());
            try
            {
                nlohmann::json data = nlohmann::json::parse(f);
                preset = data;
                preset.path = path.string();
                this->m_preset_list->Append(preset.name);
                this->Presets.emplace(preset.name, preset);
            }
            catch (const std::exception &e)
            {
                std::remove(path.string().c_str());
                std::cerr << e.what() << '\n';
            }
        }
    }
    if (type == sd_gui_utils::CHECKPOINT)
    {
        this->logs->AppendText(fmt::format("Loaded checkpoints: {}\n", this->ModelFiles.size()));
    }
    if (type == sd_gui_utils::VAE)
    {
        this->logs->AppendText(fmt::format("Loaded vaes: {}\n", this->VaeFiles.size()));
    }
    if (type == sd_gui_utils::PRESETS)
    {
        this->logs->AppendText(fmt::format("Loaded presets: {}\n", this->Presets.size()));
        if (this->Presets.size() > 0)
        {
            this->m_preset_list->Enable();
        }
    }
}
void MainWindowUI::LoadPresets()
{
    this->LoadFileList(sd_gui_utils::DirTypes::PRESETS);
}
void MainWindowUI::OnThreadMessage(wxThreadEvent &e)
{
    auto msg = e.GetString().ToStdString();
    std::string token = msg.substr(0, msg.find(":"));
    std::string content = msg.substr(msg.find(":") + 1);
    //    this->logs->AppendText(fmt::format("Got thread message: {}\n", e.GetString().ToStdString()));
    if (token == "QUEUE")
    {
        m_statusBar166->SetStatusText("got QUEUE cmd: " + msg);
        // only numbers here...
        QM::QueueEvents event = (QM::QueueEvents)std::stoi(content);
        // only handle the QUEUE messages, what this class generate
        // alway QM::EueueItem the payload, with the new data
        auto payload = e.GetPayload<QM::QueueItem>();
        switch (event)
        {
            // new item added
        case QM::QueueEvents::ITEM_ADDED:
            this->OnQueueItemManagerItemAdded(payload);
            break;
            // item status changed
        case QM::QueueEvents::ITEM_STATUS_CHANGED:
            this->OnQueueItemManagerItemAdded(payload);
            break;
            // item updated... ? ? ?
        case QM::QueueEvents::ITEM_UPDATED:
            this->OnQueueItemManagerItemAdded(payload);
            break;
        default:
            break;
        }
    }
    if (token == "MODEL_LOAD_DONE")
    {
        this->m_generate->Enable();
        this->m_model->Enable();
        this->m_vae->Enable();
        this->m_refresh->Enable();
        this->logs->AppendText(fmt::format("Model loaded: {}\n", content));
        this->sd_ctx = e.GetPayload<sd_ctx_t *>();
        if (!this->IsShownOnScreen())
        {
            this->notification->SetFlags(wxICON_INFORMATION);
            this->notification->SetTitle("SD Gui");
            this->notification->SetMessage(content);
            this->notification->Show(5000);
        }
    }
    if (token == "MODEL_LOAD_START")
    {
        this->m_generate->Disable();
        this->m_model->Disable();
        this->m_vae->Disable();
        this->m_refresh->Disable();
        this->logs->AppendText(fmt::format("Model load start: {}\n", content));
    }
    if (token == "MODEL_LOAD_ERROR")
    {
        this->m_generate->Disable();
        this->m_model->Enable();
        this->m_vae->Disable();
        this->m_refresh->Enable();
        this->logs->AppendText(fmt::format("Model load error: {}\n", content));
        if (!this->IsShownOnScreen())
        {
            this->notification->SetFlags(wxICON_ERROR);
            this->notification->SetTitle("SD Gui - error");
            this->notification->SetMessage(content);
            this->notification->Show(5000);
        }
    }
    if (token == "GENERATION_START")
    {
        sd_gui_utils::SDParams *params = e.GetPayload<sd_gui_utils::SDParams *>();
        this->m_generate->Disable();
        this->m_model->Disable();
        this->m_vae->Disable();
        this->m_refresh->Disable();
        this->logs->AppendText(fmt::format("Difusion started. Seed: {} Batch: {} {}x{}px Cfg: {} Steps: {}\n",
                                           params->seed,
                                           params->batch_count,
                                           params->width,
                                           params->height,
                                           params->cfg_scale,
                                           params->sample_steps));
    }
    // never, not implemented in sd.cpp
    if (token == "GENERATION_PROGRESS")
    {
        this->m_generate->Disable();
        this->logs->AppendText(fmt::format("Generation progress: {}\n", content));
    }
    if (token == "GENERATION_DONE")
    {
        this->m_generate->Enable();
        this->m_model->Enable();
        this->m_vae->Enable();
        this->m_refresh->Enable();
        sd_image_t *results = e.GetPayload<sd_image_t *>();
        // show images in new window...
        for (int i = 0; i < this->sd_params->batch_count; i++)
        {
            MainWindowImageViewer *imgWindow = new MainWindowImageViewer(this);
            // wxBitmap *img = new wxBitmap(results[i].data, (int)results[i].width, (int)results[i].height, (int)results[i].channel);
            wxImage img(results[i].width, results[i].height, results[i].data);
            wxBitmapBundle wxBmapB(img);
            imgWindow->m_bitmap->SetBitmap(wxBmapB);
            imgWindow->m_bitmap->SetSize(results[i].width, results[i].height);
            imgWindow->SetSize(results[i].width + 200, results[i].height);
            std::string details = fmt::format("Prompt:\n\n{}\n\nNegative prompt: \n\n{}\n\nSeed: {} \nCfg scale: {}\nClip skip: {}\nSampler: {}\nSteps: {}\nWidth: {} Height: {}",
                                              this->sd_params->prompt, this->sd_params->negative_prompt,
                                              this->sd_params->seed + i, this->sd_params->cfg_scale,
                                              this->sd_params->clip_skip, sd_gui_utils::sample_method_str[this->sd_params->sample_method], this->sd_params->sample_steps,
                                              results[i].width, results[i].height);
            imgWindow->m_textCtrl4->AppendText(wxString(details));
            imgWindow->Show();
            // imgWindow->m_bitmap->SetBitmap(img);
            /// imgWindow->m_bitmap->Set
        }
    }
    if (token == "GENERATION_ERROR")
    {
        this->m_generate->Enable();
        this->m_model->Enable();
        this->m_vae->Enable();
        this->logs->AppendText(fmt::format("Generation error: {}\n", content));
        if (!this->IsShownOnScreen())
        {
            this->notification->SetFlags(wxICON_ERROR);
            this->notification->SetTitle("SD Gui - error");
            this->notification->SetMessage(content);
            this->notification->Show(5000);
        }
    }
    if (token == "SD_MESSAGE")
    {
        if (content.length() < 1)
        {
            return;
        }
        this->logs->AppendText(fmt::format("{}", content));
    }
    if (token == "MESSAGE")
    {
        this->logs->AppendText(fmt::format("{}\n", content));
        if (!this->IsShownOnScreen())
        {
            this->notification->SetFlags(wxICON_INFORMATION);
            this->notification->SetTitle("SD Gui");
            this->notification->SetMessage(content);
            this->notification->Show(5000);
        }
    }
}
void MainWindowUI::LoadModel(wxEvtHandler *eventHandler)
{
    wxThreadEvent *e = new wxThreadEvent();
    e->SetString(wxString::Format("MODEL_LOAD_START:%s", this->sd_params->model_path));
    wxQueueEvent(eventHandler, e);
    /*this->sd_ctx = new_sd_ctx(this->sd_params->model_path.c_str(),
                              this->sd_params->vae_path.c_str(),
                              this->sd_params->taesd_path.c_str(),
                              this->sd_params->controlnet_path.c_str(),
                              std::string(this->sd_params->lora_model_dir + "\\").c_str(),
                              this->sd_params->embeddings_path.c_str(),
                              true, // vae decode only
                              true ,
                              !this->cfg->keep_model_in_memory,
                              this->sd_params->n_threads,
                              this->sd_params->wtype ,
                              this->sd_params->rng_type,
                              this->sd_params->schedule,
                              this->sd_params->control_net_cpu);*/
    this->sd_ctx = new_sd_ctx(this->sd_params->model_path.c_str(), this->sd_params->vae_path.c_str(), this->sd_params->taesd_path.c_str(), this->sd_params->lora_model_dir.c_str(), true, false, false, this->sd_params->n_threads, this->sd_params->wtype, this->sd_params->rng_type, this->sd_params->schedule);
    if (this->sd_ctx == NULL)
    {
        wxThreadEvent *c = new wxThreadEvent();
        c->SetString(wxString::Format("MODEL_LOAD_ERROR:%s", this->sd_params->model_path));
        wxQueueEvent(eventHandler, c);
        return;
    }
    else
    {
        wxThreadEvent *c = new wxThreadEvent();
        c->SetString(wxString::Format("MODEL_LOAD_DONE:%s", this->sd_params->model_path));
        // c->SetEventObject(this->sd_ctx);
        c->SetPayload(this->sd_ctx);
        wxQueueEvent(eventHandler, c);
        return;
    }
    return;
}
void MainWindowUI::initConfig()
{
    wxString datapath = wxStandardPaths::Get().GetUserDataDir() + wxFileName::GetPathSeparator() + "sd_ui_data" + wxFileName::GetPathSeparator();
    wxString imagespath = wxStandardPaths::Get().GetDocumentsDir() + wxFileName::GetPathSeparator() + "sd_ui_output" + wxFileName::GetPathSeparator();
    wxString model_path = datapath;
    model_path.append("checkpoints");
    wxString vae_path = datapath;
    vae_path.append("vae");
    wxString lora_path = datapath;
    lora_path.append("lora");
    wxString embedding_path = datapath;
    embedding_path.append("embedding");
    wxString presets_path = datapath;
    presets_path.append("presets");
    wxString jobs_path = datapath;
    jobs_path.append("queue_jobs");
    this->cfg->lora = this->fileConfig->Read("/paths/lora", lora_path).ToStdString();
    this->cfg->model = this->fileConfig->Read("/paths/model", model_path).ToStdString();
    this->cfg->vae = this->fileConfig->Read("/paths/vae", vae_path).ToStdString();
    this->cfg->embedding = this->fileConfig->Read("/paths/embedding", embedding_path).ToStdString();
    this->cfg->presets = this->fileConfig->Read("/paths/presets", presets_path).ToStdString();
    this->cfg->jobs = this->fileConfig->Read("/paths/presets", jobs_path).ToStdString();
    this->cfg->output = this->fileConfig->Read("/paths/output", imagespath).ToStdString();
    this->cfg->keep_model_in_memory = this->fileConfig->Read("/keep_model_in_memory", this->cfg->keep_model_in_memory);
    this->cfg->save_all_image = this->fileConfig->Read("/save_all_image", this->cfg->save_all_image);
    // populate data from sd_params as default...
    if (!this->m_generate->IsEnabled())
    {
        this->m_cfg->SetValue(static_cast<double>(this->sd_params->cfg_scale));
        this->m_seed->SetValue(static_cast<int>(this->sd_params->seed));
        this->m_clip_skip->SetValue(this->sd_params->clip_skip);
        this->m_steps->SetValue(this->sd_params->sample_steps);
        this->m_width->SetValue(this->sd_params->width);
        this->m_height->SetValue(this->sd_params->height);
        this->m_batch_count->SetValue(this->sd_params->batch_count);
    }
    // hide unusable configs...
    /*
    if (SD_CPP_VERSION == "c6071fa") {
            // .. nope, configs in another window...
    }*/
}
void MainWindowUI::StartGeneration()
{
    // prepare params
    this->sd_params->model_path = this->ModelFiles.at(this->m_model->GetStringSelection().ToStdString());
    this->sd_params->lora_model_dir = this->cfg->lora;
    this->sd_params->embeddings_path = this->cfg->embedding;
    this->sd_params->prompt = this->m_prompt->GetValue().ToStdString();
    this->sd_params->negative_prompt = this->m_neg_prompt->GetValue().ToStdString();
    this->sd_params->cfg_scale = static_cast<float>(this->m_cfg->GetValue());
    this->sd_params->seed = this->m_seed->GetValue();
    this->sd_params->clip_skip = this->m_clip_skip->GetValue();
    this->sd_params->sample_steps = this->m_steps->GetValue();
    /* sample method */
    this->sd_params->sample_method = (sample_method_t)this->m_sampler->GetCurrentSelection();
    /* sample method */
    this->sd_params->batch_count = this->m_batch_count->GetValue();
    this->sd_params->width = this->m_width->GetValue();
    this->sd_params->height = this->m_height->GetValue();
    this->threads.push_back(std::thread(std::bind(&MainWindowUI::Generate, this, this->GetEventHandler())));
}
void MainWindowUI::OnCloseSettings(wxCloseEvent &event)
{
    this->initConfig();
    this->settingsWindow->Destroy();
}
void MainWindowUI::loadModelList()
{
    this->m_sampler->Clear();
    for (auto sampler : sd_gui_utils::sample_method_str)
    {
        int _u = this->m_sampler->Append(sampler);
        if (sampler == sd_gui_utils::sample_method_str[this->sd_params->sample_method])
        {
            this->m_sampler->Select(_u);
        }
    }
    this->LoadFileList(sd_gui_utils::DirTypes::CHECKPOINT);
    for (auto model : this->ModelFiles)
    {
        // auto size = sd_gui_utils::HumanReadable{std::filesystem::file_size(model.second)};
        auto size = std::filesystem::file_size(model.second);
        wxVector<wxVariant> data;
        data.push_back(wxVariant(model.first));
        data.push_back(wxVariant(std::to_string(size)));
        this->m_data_model_list->AppendItem(data);
    }
    this->m_data_model_list->Refresh();
}
void MainWindowUI::Generate(wxEvtHandler *eventHandler)
{
    // calculate time
    auto start = std::chrono::system_clock::now();
    wxThreadEvent *e = new wxThreadEvent();
    e->SetString(wxString::Format("GENERATION_START:%s", this->sd_params->model_path));
    e->SetPayload(this->sd_params);
    wxQueueEvent(eventHandler, e);
    sd_image_t *control_image = NULL;
    sd_image_t *results;
    /*results = txt2img(sd_ctx,
                      this->sd_params->prompt.c_str(),
                      this->sd_params->negative_prompt.c_str(),
                      this->sd_params->clip_skip,
                      this->sd_params->cfg_scale,
                      this->sd_params->width,
                      this->sd_params->height,
                      this->sd_params->sample_method,
                      this->sd_params->sample_steps,
                      this->sd_params->seed,
                      this->sd_params->batch_count,
                      control_image,
                      this->sd_params->control_strength);*/
    results = txt2img(this->sd_ctx,
                      this->sd_params->prompt.c_str(), this->sd_params->negative_prompt.c_str(), this->sd_params->clip_skip, this->sd_params->cfg_scale, this->sd_params->width, this->sd_params->height, this->sd_params->sample_method, this->sd_params->sample_steps, this->sd_params->seed, this->sd_params->batch_count);
    if (results == NULL)
    {
        wxThreadEvent *f = new wxThreadEvent();
        f->SetString("GENERATION_ERROR:Something wrong happened at image generation...");
        wxQueueEvent(eventHandler, f);
        return;
    }
    if (!std::filesystem::exists(this->cfg->output))
    {
        std::filesystem::create_directories(this->cfg->output);
    }
    /* save image(s) */
    const auto p1 = std::chrono::system_clock::now();
    auto ctime = std::chrono::duration_cast<std::chrono::seconds>(p1.time_since_epoch()).count();
    for (int i = 0; i < this->sd_params->batch_count; i++)
    {
        if (results[i].data == NULL)
        {
            continue;
        }
        // handle data??
        wxImage *img = new wxImage(results[i].width, results[i].height, results[i].data);
        std::string filename = this->cfg->output;
        std::string extension = ".png";
        if (this->sd_params->batch_count > 1)
        {
            filename = filename + wxFileName::GetPathSeparator() + std::to_string(ctime) + "_" + std::to_string(i) + extension;
        }
        else
        {
            filename = filename + wxFileName::GetPathSeparator() + std::to_string(ctime) + extension;
        }
        if (!img->SaveFile(filename))
        {
            wxThreadEvent *g = new wxThreadEvent();
            g->SetString(wxString::Format("GENERATION_ERROR:Failed to save image into %s", filename));
            wxQueueEvent(eventHandler, g);
        }
        // handle data??
    }
    auto end = std::chrono::system_clock::now();
    std::chrono::duration<double> elapsed_seconds = end - start;
    // send to notify the user...
    wxThreadEvent *h = new wxThreadEvent();
    auto msg = fmt::format("MESSAGE:Image generation done in {}s. Saved into {}", elapsed_seconds.count(), this->cfg->output);
    h->SetString(wxString(msg.c_str()));
    wxQueueEvent(eventHandler, h);
    // send to reset the buttons
    wxThreadEvent *i = new wxThreadEvent();
    i->SetString(wxString::Format("GENERATION_DONE:ok"));
    i->SetPayload(results);
    wxQueueEvent(eventHandler, i);
    return;
}
void MainWindowUI::HandleSDLog(sd_log_level_t level, const char *text, void *data)
{
    // wxEvtHandler *eventHandler = (wxEvtHandler *)data;
    MainWindowUI *ui = (MainWindowUI *)data;
    wxEvtHandler *eventHandler = ui->GetEventHandler();
    wxThreadEvent *e = new wxThreadEvent();
    e->SetString(wxString::Format("SD_MESSAGE:%s", text));
    e->SetPayload(level);
    wxQueueEvent(eventHandler, e);
}
void MainWindowUI::OnQueueItemManagerItemStatusChanged(QM::QueueItem item)
{
}
MainWindowUI::~MainWindowUI()
{
    // clean up things...
    if (this->m_generate->IsEnabled())
    {
        free_sd_ctx(this->sd_ctx);
    }
    for (int i = 0; i < this->threads.size(); i++)
    {
        this->threads.at(i).join();
    }
    this->threads.clear();
    this->Destroy();
    exit(0);
}
void MainWindowUI::loadVaeList()
{
    if (!std::filesystem::exists(this->cfg->vae))
    {
        std::filesystem::create_directories(this->cfg->vae);
    }
    this->LoadFileList(sd_gui_utils::DirTypes::VAE);
}
void MainWindowUI::OnQueueItemManagerItemUpdated(QM::QueueItem item)
{
}
void MainWindowUI::StartLoadModel()
{
    // prepare
    auto selection = this->m_model->GetStringSelection();
    if (selection == "-none-")
    {
        free_sd_ctx(this->sd_ctx);
        return;
    }
    if (this->m_generate->IsEnabled())
    {
        free_sd_ctx(this->sd_ctx);
    }
    // disable ui
    this->m_model->Disable();
    this->m_vae->Disable();
    this->m_refresh->Disable();
    this->sd_params->model_path = this->ModelFiles.at(selection.ToStdString());
    this->sd_params->lora_model_dir = this->fileConfig->Read("/paths/lora", "").ToStdString();
    this->threads.push_back(std::thread(std::bind(&MainWindowUI::LoadModel, this, this->GetEventHandler())));
}
ui/MainWindowUI.h
New file
@@ -0,0 +1,106 @@
#ifndef __MainWindowUI__
#define __MainWindowUI__
/**
@file
Subclass of UI, which is generated by wxFormBuilder.
*/
#include "MainWindow.h"
//// end generated include
#include "ver.hpp"
#include "MainWindowSettings.h"
#include "MainWindowImageViewer.h"
#include "QueueManager.h"
#include <filesystem>
#include <map>
#include <thread>
#include <vector>
#include <fstream>
#include <fmt/format.h>
#include "utils.hpp"
#include <stable-diffusion.h>
#include <wx/fileconf.h>
#include <wx/stdpaths.h>
#include <wx/event.h>
#include <wx/notifmsg.h>
#include <wx/textdlg.h>
/** Implementing UI */
class MainWindowUI : public UI
{
    protected:
        // Handlers for UI events.
        void onSettings( wxCommandEvent& event );
        void onModelsRefresh( wxCommandEvent& event );
        void onModelSelect( wxCommandEvent& event );
        void onVaeSelect( wxCommandEvent& event );
        void onSamplerSelect( wxCommandEvent& event );
        void onResolutionSwap( wxCommandEvent& event );
        void onJobsStart( wxCommandEvent& event );
        void onJobsPause( wxCommandEvent& event );
        void onJobsDelete( wxCommandEvent& event );
        void onJoblistItemActivated( wxDataViewEvent& event );
        void onJoblistSelectionChanged( wxDataViewEvent& event );
        void onGenerate( wxCommandEvent& event );
        void onSavePreset( wxCommandEvent& event );
        void onLoadPreset( wxCommandEvent& event );
        void onSelectPreset( wxCommandEvent& event );
        void onDeletePreset( wxCommandEvent& event );
    public:
        /** Constructor */
        MainWindowUI( wxWindow* parent );
    //// end generated class members
    ~MainWindowUI();
    void OnThreadMessage(wxThreadEvent &e);
private:
    wxFileConfig *fileConfig;
    sd_gui_utils::config *cfg;
    wxString ini_path;
    MainWindowSettings *settingsWindow;
    sd_gui_utils::SDParams *sd_params;
    std::map<std::string, std::string> ModelFiles;
    std::map<std::string, std::string> VaeFiles;
    std::map<std::string, sd_gui_utils::generator_preset> Presets;
    // the queue manager
    QM::QueueManager *qmanager;
    sd_ctx_t *sd_ctx;
    std::streambuf *buffer;
    std::vector<std::thread> threads;
    void initConfig();
    void loadModelList();
    void loadVaeList();
    void OnCloseSettings(wxCloseEvent &event);
    void LoadFileList(sd_gui_utils::DirTypes type = sd_gui_utils::DirTypes::CHECKPOINT);
    void LoadPresets();
    static void HandleSDLog(sd_log_level_t level, const char *text, void *data);
    // load the model in a new thread
    void LoadModel(wxEvtHandler *eventHandler);
    // generate in another thread
    void Generate(wxEvtHandler *eventHandler);
    // start a thread for model loading...
    void StartLoadModel();
    // start a thread to generate image
    void StartGeneration();
    // handle queue managers events, manipulate data table by events
    void OnQueueItemManagerItemAdded(QM::QueueItem item);
    void OnQueueItemManagerItemUpdated(QM::QueueItem item);
    void OnQueueItemManagerItemStatusChanged(QM::QueueItem item);
    wxNotificationMessage *notification;
};
#endif // __MainWindowUI__
ui/QueueManager.cpp
New file
@@ -0,0 +1,129 @@
#include "QueueManager.h"
QM::QueueManager::QueueManager(wxEvtHandler *eventHandler, std::string jobsdir)
{
    // need to send events into the mainwindow by the threads...
    this->eventHandler = eventHandler;
    this->eventHandler->Bind(wxEVT_THREAD, &QueueManager::OnThreadMessage, this);
    this->jobsDir = jobsdir;
}
int QM::QueueManager::AddItem(QM::QueueItem item)
{
    if (!item.id)
    {
        item.id = this->GetCurrentUnixTimestamp();
    }
    this->QueueList[item.id] = item;
    this->SendEventToMainWindow(QM::QueueEvents::ITEM_ADDED, item);
    return item.id;
}
int QM::QueueManager::AddItem(sd_gui_utils::SDParams *params)
{
    QM::QueueItem item;
    item.params = *params;
    item.created_at = item.id = this->GetCurrentUnixTimestamp();
    this->AddItem(item);
    return item.id;
}
int QM::QueueManager::AddItem(sd_gui_utils::SDParams params)
{
    QM::QueueItem item;
    item.params = params;
    item.created_at = item.id = this->GetCurrentUnixTimestamp();
    this->AddItem(item);
    return item.id;
}
QM::QueueItem QM::QueueManager::GetItem(int id)
{
    if (this->QueueList.find(id) == this->QueueList.end())
    {
        return QM::QueueItem();
    }
    else
    {
        return this->QueueList.at(id);
    }
}
QM::QueueItem QM::QueueManager::GetItem(QM::QueueItem item)
{
    return this->GetItem(item.id);
}
const std::map<int, QM::QueueItem> QM::QueueManager::getList()
{
    return this->QueueList;
}
int QM::QueueManager::Duplicate(QM::QueueItem item)
{
    if (this->QueueList.find(item.id) == this->QueueList.end())
    {
        return -1;
    }
    else
    {
        return this->AddItem(this->QueueList.at(item.id).params);
    }
}
int QM::QueueManager::Duplicate(int id)
{
    return this->AddItem(this->GetItem(id).params);
}
void QM::QueueManager::SetStatus(QM::QueueStatus status, int id)
{
    // todo, start - stop - pause
    auto item = this->GetItem(id);
    item.status = status;
    this->SendEventToMainWindow(QM::QueueEvents::ITEM_STATUS_CHANGED, item);
}
void QM::QueueManager::PauseAll()
{
    for (auto &[key, value] : this->QueueList)
    {
        if (value.status == QM::QueueStatus::PENDING)
        {
            this->SetStatus(QM::PAUSED, key);
            this->SendEventToMainWindow(QM::QueueEvents::ITEM_STATUS_CHANGED);
        }
    }
}
void QM::QueueManager::SendEventToMainWindow(QM::QueueEvents eventType, QM::QueueItem item)
{
    wxThreadEvent *e = new wxThreadEvent();
    // e->SetString(wxString::Format("MODEL_LOAD_START:%s", this->sd_params->model_path));
    e->SetString(wxString("QUEUE:" + (int)eventType));
    e->SetPayload(item);
    wxQueueEvent(this->eventHandler, e);
}
void QM::QueueManager::OnThreadMessage(wxThreadEvent &e)
{
    auto msg = e.GetString().ToStdString();
    std::string token = msg.substr(0, msg.find(":"));
    std::string content = msg.substr(msg.find(":") + 1);
    // only numbers here...
    QM::QueueEvents event = (QM::QueueEvents)std::stoi(content);
    // only handle the QUEUE messages, what this class generate
}
int QM::QueueManager::GetCurrentUnixTimestamp()
{
    const auto p1 = std::chrono::system_clock::now();
    return static_cast<int>(std::chrono::duration_cast<std::chrono::seconds>(p1.time_since_epoch()).count());
}
void QM::QueueManager::onItemAdded(QM::QueueItem item)
{
    // this->parent->m_joblist
    // auto dataTable = this->parent->m_joblist;
}
ui/QueueManager.h
New file
@@ -0,0 +1,116 @@
#ifndef __SD_GUI_QUEUE_MANAGER
#define __SD_GUI_QUEUE_MANAGER
#include <map>
#include <chrono>
#include <nlohmann/json.hpp>
#include "utils.hpp"
#include <wx/event.h>
#include <wx/window.h>
namespace QM
{
    enum QueueStatus
    {
        PENDING,
        RUNNING,
        PAUSED,
        FAILED
    };
    inline const char *QueueStatus_str[] = {
        "pending",
        "running",
        "paused",
        "failed"};
    enum QueueEvents
    {
        ITEM_DELETED,
        ITEM_ADDED,
        ITEM_STATUS_CHANGED,
        ITEM_UPDATED
    };
    struct QueueItem
    {
        QueueItem() = default;
        QueueItem(const QueueItem &other)
            : id(other.id), created_at(other.created_at), updated_at(other.updated_at),
              finished_at(other.finished_at), params(other.params), status(other.status) {}
        QueueItem &operator=(const QueueItem &other)
        {
            if (this != &other)
            {
                id = other.id;
                created_at = other.created_at;
                updated_at = other.updated_at;
                finished_at = other.finished_at;
                // Másolatot készítünk a params referenciáról
                // Ha a params referenciához tartozó SDParams objektum módosulna,
                // akkor ebben az esetben másolatban marad az eredeti QueueItem-ben
                params = other.params;
                status = other.status;
            }
            return *this;
        }
        int id, created_at, updated_at, finished_at;
        sd_gui_utils::SDParams params;
        QM::QueueStatus status = QM::QueueStatus::PENDING;
    };
    inline void to_json(nlohmann::json &j, const QueueItem &p)
    {
        j = nlohmann::json{
            {"id", p.id},
            {"created_at", p.created_at},
            {"updated_at", p.updated_at},
            {"finished_at", p.finished_at},
            //   {"params", p.params},
            {"status", (int)p.status}};
    }
    inline void from_json(const nlohmann::json &j, QueueItem &p)
    {
        j.at("id").get_to(p.id);
        j.at("created_at").get_to(p.created_at);
        j.at("updated_at").get_to(p.updated_at);
        j.at("finished_at").get_to(p.finished_at);
        //  j.at("params").get_to(p.params);
        p.status = j.at("status").get<QM::QueueStatus>();
    }
    class QueueManager
    {
    public:
        QueueManager(wxEvtHandler *eventHandler, std::string jobsdir);
        int AddItem(QM::QueueItem item);
        int AddItem(sd_gui_utils::SDParams *params);
        int AddItem(sd_gui_utils::SDParams params);
        QM::QueueItem GetItem(int id);
        QM::QueueItem GetItem(QM::QueueItem item);
        const std::map<int, QM::QueueItem> getList();
        int Duplicate(QM::QueueItem item);
        int Duplicate(int id);
        void SetStatus(QM::QueueStatus status, int id);
        void PauseAll();
        void SendEventToMainWindow(QM::QueueEvents eventType, QM::QueueItem item = QM::QueueItem());
        void OnThreadMessage(wxThreadEvent &e);
    private:
        int GetCurrentUnixTimestamp();
        std::string jobsDir;
        // thread events handler, toupdate main window data table
        void onItemAdded(QM::QueueItem item);
        void LodJobsFromFile();
        void SaveJobsToFile();
        wxEvtHandler *eventHandler;
        wxWindow *parent;
        std::map<int, QM::QueueItem> QueueList;
    };
};
#endif
ui/embended_files/cube.png.h
New file
@@ -0,0 +1,59 @@
#ifndef CUBE_PNG_H
#define CUBE_PNG_H
#include <wx/mstream.h>
#include <wx/image.h>
#include <wx/bitmap.h>
static const unsigned char cube_png[] =
{
    0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00,
    0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x10,
    0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1F,
    0xF3, 0xFF, 0x61, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59,
    0x73, 0x00, 0x00, 0x09, 0xD7, 0x00, 0x00, 0x09, 0xD7, 0x01,
    0xB1, 0x6E, 0x17, 0xB7, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45,
    0x58, 0x74, 0x53, 0x6F, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65,
    0x00, 0x77, 0x77, 0x77, 0x2E, 0x69, 0x6E, 0x6B, 0x73, 0x63,
    0x61, 0x70, 0x65, 0x2E, 0x6F, 0x72, 0x67, 0x9B, 0xEE, 0x3C,
    0x1A, 0x00, 0x00, 0x01, 0x07, 0x49, 0x44, 0x41, 0x54, 0x38,
    0x8D, 0x9D, 0xD3, 0xBF, 0x2B, 0x45, 0x61, 0x18, 0x07, 0xF0,
    0x0F, 0x09, 0x77, 0xBC, 0xC9, 0x70, 0x07, 0x56, 0x5D, 0x93,
    0x0C, 0xCA, 0xAE, 0x4C, 0x5C, 0x8B, 0x49, 0xB1, 0x59, 0x6D,
    0x14, 0x45, 0x26, 0xF9, 0x03, 0x98, 0x8C, 0x26, 0x37, 0x72,
    0xA3, 0x63, 0x91, 0x7F, 0x81, 0xBF, 0xC0, 0x64, 0x53, 0xCA,
    0x20, 0x4A, 0x61, 0x78, 0xCF, 0xBD, 0x1D, 0xD7, 0x79, 0xCF,
    0xC1, 0xB7, 0xDE, 0xE5, 0xF9, 0x3E, 0xDF, 0xE7, 0xF7, 0x4B,
    0x1C, 0x75, 0x34, 0xD3, 0x57, 0x2F, 0xF0, 0xFB, 0x81, 0x2A,
    0xF6, 0x70, 0x8C, 0x51, 0xD4, 0x70, 0x80, 0x43, 0x0C, 0x17,
    0x09, 0xFB, 0xB0, 0x8A, 0x4B, 0x4C, 0xE7, 0xF0, 0x93, 0x38,
    0xC7, 0x06, 0xFA, 0xBB, 0xC9, 0x19, 0x24, 0x58, 0x46, 0x4F,
    0x49, 0x85, 0x73, 0xB8, 0xC2, 0x62, 0xD6, 0xF8, 0x84, 0x23,
    0x0C, 0x95, 0x88, 0x61, 0x00, 0xDB, 0x78, 0xCB, 0x1A, 0x4F,
    0x30, 0x81, 0x16, 0xD6, 0x84, 0x76, 0x62, 0xD9, 0x93, 0x34,
    0x7B, 0x13, 0x7A, 0x33, 0xE4, 0x1D, 0x1A, 0xB8, 0x17, 0xE6,
    0x30, 0x9B, 0xE1, 0xA6, 0x84, 0xFE, 0xC7, 0xB1, 0x90, 0x8A,
    0x3F, 0x45, 0x32, 0x5D, 0xE0, 0x06, 0x9B, 0x58, 0x12, 0x66,
    0xF2, 0x80, 0x15, 0x3C, 0x77, 0x3B, 0xC7, 0x4A, 0x7D, 0xC1,
    0x96, 0x30, 0xD4, 0x0F, 0x61, 0xA5, 0xB9, 0x88, 0x05, 0x68,
    0xE3, 0xB5, 0x84, 0xFF, 0x36, 0x83, 0x7F, 0xA1, 0x1D, 0xA0,
    0x86, 0xCA, 0x1F, 0x74, 0x95, 0x54, 0xD3, 0x09, 0xB0, 0x8B,
    0x53, 0xBF, 0x3F, 0xA4, 0x33, 0xEC, 0x67, 0x03, 0x5C, 0x63,
    0x1E, 0x83, 0xC2, 0x16, 0x62, 0xA7, 0xDC, 0x12, 0x56, 0xD9,
    0x10, 0x56, 0x9D, 0x9B, 0xAD, 0x8A, 0x75, 0x8C, 0xE0, 0x16,
    0xEF, 0x18, 0x4B, 0x7D, 0x77, 0xF0, 0x58, 0x52, 0x61, 0x07,
    0x75, 0xE1, 0xEA, 0x12, 0x05, 0xDF, 0xF9, 0x0B, 0x82, 0x43,
    0x2C, 0xFB, 0x11, 0x35, 0x04, 0x4C, 0x00, 0x00, 0x00, 0x00,
    0x49, 0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60, 0x82,
};
wxBitmap& cube_png_to_wx_bitmap()
{
    static wxMemoryInputStream memIStream( cube_png, sizeof( cube_png ) );
    static wxImage image( memIStream, wxBITMAP_TYPE_PNG );
    static wxBitmap bmp( image );
    return bmp;
}
#endif //CUBE_PNG_H
ui/embended_files/disk.png.h
New file
@@ -0,0 +1,56 @@
#ifndef DISK_PNG_H
#define DISK_PNG_H
#include <wx/mstream.h>
#include <wx/image.h>
#include <wx/bitmap.h>
static const unsigned char disk_png[] =
{
    0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00,
    0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x10,
    0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1F,
    0xF3, 0xFF, 0x61, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59,
    0x73, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x76, 0x01,
    0x4E, 0x7B, 0x26, 0x08, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45,
    0x58, 0x74, 0x53, 0x6F, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65,
    0x00, 0x77, 0x77, 0x77, 0x2E, 0x69, 0x6E, 0x6B, 0x73, 0x63,
    0x61, 0x70, 0x65, 0x2E, 0x6F, 0x72, 0x67, 0x9B, 0xEE, 0x3C,
    0x1A, 0x00, 0x00, 0x00, 0xEB, 0x49, 0x44, 0x41, 0x54, 0x38,
    0x8D, 0xA5, 0xD2, 0x31, 0x4A, 0x03, 0x51, 0x10, 0xC6, 0xF1,
    0x9F, 0x62, 0x2D, 0x78, 0x00, 0x0B, 0x09, 0x76, 0x62, 0x29,
    0xB1, 0x88, 0x58, 0x58, 0x08, 0xD6, 0x8B, 0xAD, 0x07, 0x50,
    0x90, 0x5C, 0x40, 0xF0, 0x00, 0x7A, 0x06, 0x83, 0x58, 0x24,
    0x45, 0x04, 0x1B, 0x3B, 0xED, 0x82, 0x22, 0x62, 0xE3, 0x09,
    0xCC, 0x05, 0x44, 0x2B, 0x11, 0xD6, 0x62, 0x27, 0xB0, 0x3E,
    0x76, 0xD5, 0x8D, 0x1F, 0x4C, 0x31, 0xF3, 0x66, 0xFE, 0x6F,
    0xE6, 0xBD, 0x81, 0x1D, 0x8C, 0x91, 0xFF, 0xD1, 0x5E, 0xB1,
    0x2E, 0x34, 0x83, 0x17, 0x3C, 0xE0, 0x02, 0xDD, 0x88, 0x9F,
    0xA8, 0x56, 0x17, 0x6B, 0x78, 0xC7, 0x36, 0x46, 0x82, 0x9A,
    0x45, 0x42, 0x3F, 0xAC, 0x4E, 0x7D, 0x5C, 0x62, 0x18, 0x90,
    0x8D, 0xD9, 0x1F, 0x92, 0xEB, 0xF4, 0x81, 0x5D, 0xDC, 0xE0,
    0xAA, 0x0A, 0x90, 0xA9, 0x9F, 0x3F, 0x2B, 0x41, 0x7A, 0x98,
    0x9F, 0x4B, 0x8A, 0x4F, 0x31, 0xF8, 0xA5, 0x83, 0x71, 0xD9,
    0x49, 0x01, 0xA3, 0xE4, 0xAC, 0x13, 0xB7, 0xDD, 0xE1, 0xB3,
    0x8A, 0x96, 0x02, 0x26, 0x5A, 0xC0, 0x2D, 0x56, 0xC3, 0xBF,
    0xC7, 0x16, 0xDE, 0xD2, 0xC4, 0xBA, 0x47, 0x3C, 0xC4, 0x22,
    0x56, 0x02, 0xD2, 0xC2, 0x41, 0x93, 0x0E, 0x5A, 0x78, 0xC4,
    0x73, 0xF8, 0x4F, 0x58, 0x6E, 0x02, 0xB8, 0xC6, 0x19, 0x8E,
    0x15, 0xB3, 0x6F, 0x62, 0xAF, 0x09, 0xE0, 0x1C, 0x4B, 0xD8,
    0x57, 0x6C, 0xEB, 0x51, 0xC4, 0x2A, 0x55, 0xFE, 0xDF, 0x26,
    0xCA, 0x90, 0x4F, 0xB3, 0x89, 0xDF, 0x34, 0x19, 0xA1, 0x3D,
    0x45, 0x6D, 0x9B, 0x62, 0xBE, 0xFC, 0x3F, 0x1D, 0x7C, 0x01,
    0x49, 0xD6, 0x3A, 0x64, 0x4D, 0x76, 0xB5, 0x9B, 0x00, 0x00,
    0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60, 0x82,
};
wxBitmap& disk_png_to_wx_bitmap()
{
    static wxMemoryInputStream memIStream( disk_png, sizeof( disk_png ) );
    static wxImage image( memIStream, wxBITMAP_TYPE_PNG );
    static wxBitmap bmp( image );
    return bmp;
}
#endif //DISK_PNG_H
ui/embended_files/file_import.png.h
New file
@@ -0,0 +1,53 @@
#ifndef FILE_IMPORT_PNG_H
#define FILE_IMPORT_PNG_H
#include <wx/mstream.h>
#include <wx/image.h>
#include <wx/bitmap.h>
static const unsigned char file_import_png[] =
{
    0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00,
    0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x10,
    0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1F,
    0xF3, 0xFF, 0x61, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59,
    0x73, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x76, 0x01,
    0x4E, 0x7B, 0x26, 0x08, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45,
    0x58, 0x74, 0x53, 0x6F, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65,
    0x00, 0x77, 0x77, 0x77, 0x2E, 0x69, 0x6E, 0x6B, 0x73, 0x63,
    0x61, 0x70, 0x65, 0x2E, 0x6F, 0x72, 0x67, 0x9B, 0xEE, 0x3C,
    0x1A, 0x00, 0x00, 0x00, 0xCA, 0x49, 0x44, 0x41, 0x54, 0x38,
    0x8D, 0x9D, 0xD2, 0x31, 0x6E, 0x02, 0x31, 0x10, 0x85, 0xE1,
    0x0F, 0x44, 0x89, 0xA8, 0x39, 0x4A, 0xA2, 0x5C, 0x60, 0x05,
    0xF5, 0xD2, 0xA6, 0x26, 0xE9, 0x38, 0x46, 0x8A, 0x6C, 0x93,
    0x2B, 0xA4, 0x59, 0x5A, 0xC4, 0x05, 0x52, 0x04, 0x89, 0x2A,
    0x17, 0x41, 0x51, 0x0A, 0x2A, 0x04, 0x14, 0x59, 0x4B, 0xB0,
    0xAC, 0xBD, 0x2B, 0x9E, 0x64, 0x69, 0xE4, 0x99, 0xF7, 0x7B,
    0xC6, 0x36, 0xFF, 0x1A, 0xE3, 0x0B, 0x07, 0x9C, 0x22, 0xEB,
    0x88, 0x57, 0x11, 0xBD, 0x27, 0x8C, 0x75, 0xC8, 0xBC, 0x09,
    0x50, 0x56, 0x05, 0x79, 0xE4, 0x80, 0x90, 0x0F, 0x90, 0x97,
    0x90, 0xE8, 0xC7, 0x5A, 0x4A, 0xA8, 0x87, 0x0F, 0x3C, 0xDF,
    0x0B, 0x08, 0x90, 0x29, 0x0C, 0x3A, 0x1A, 0x0A, 0x2C, 0xAB,
    0xF8, 0x01, 0x8B, 0x90, 0x48, 0x01, 0x46, 0xF8, 0xAB, 0xE2,
    0xEF, 0x58, 0x51, 0x18, 0xA1, 0xC0, 0xAC, 0x56, 0xB8, 0xC6,
    0xB0, 0xAD, 0xB5, 0x81, 0xEB, 0x9B, 0x7F, 0xBC, 0x88, 0x9F,
    0xB0, 0xC2, 0x04, 0xFB, 0x14, 0xA4, 0xED, 0xED, 0xDF, 0x6A,
    0xF5, 0x79, 0xB5, 0x5F, 0x86, 0x0E, 0x96, 0x9A, 0x95, 0x63,
    0x87, 0xCF, 0xB6, 0x11, 0x66, 0x91, 0xDC, 0x2F, 0x32, 0xFC,
    0xA4, 0x00, 0xE1, 0x12, 0x9B, 0x7E, 0x62, 0x86, 0x6D, 0xCA,
    0x7C, 0x09, 0x68, 0xD2, 0xA6, 0xCD, 0xCC, 0xED, 0x3F, 0x28,
    0xBB, 0x98, 0xBA, 0x76, 0xD0, 0x49, 0x67, 0x0C, 0x18, 0x38,
    0x64, 0xC1, 0xDF, 0xEF, 0x22, 0x00, 0x00, 0x00, 0x00, 0x49,
    0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60, 0x82,
};
wxBitmap& file_import_png_to_wx_bitmap()
{
    static wxMemoryInputStream memIStream( file_import_png, sizeof( file_import_png ) );
    static wxImage image( memIStream, wxBITMAP_TYPE_PNG );
    static wxBitmap bmp( image );
    return bmp;
}
#endif //FILE_IMPORT_PNG_H
ui/embended_files/forward.png.h
New file
@@ -0,0 +1,51 @@
#ifndef FORWARD_PNG_H
#define FORWARD_PNG_H
#include <wx/mstream.h>
#include <wx/image.h>
#include <wx/bitmap.h>
static const unsigned char forward_png[] =
{
    0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00,
    0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x10,
    0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1F,
    0xF3, 0xFF, 0x61, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59,
    0x73, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x76, 0x01,
    0x4E, 0x7B, 0x26, 0x08, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45,
    0x58, 0x74, 0x53, 0x6F, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65,
    0x00, 0x77, 0x77, 0x77, 0x2E, 0x69, 0x6E, 0x6B, 0x73, 0x63,
    0x61, 0x70, 0x65, 0x2E, 0x6F, 0x72, 0x67, 0x9B, 0xEE, 0x3C,
    0x1A, 0x00, 0x00, 0x00, 0xB0, 0x49, 0x44, 0x41, 0x54, 0x38,
    0x8D, 0xCD, 0xD2, 0x31, 0x8E, 0x41, 0x61, 0x14, 0xC5, 0xF1,
    0x1F, 0x95, 0x68, 0x2C, 0xC2, 0x24, 0xAC, 0x40, 0xC4, 0x0A,
    0x2C, 0x43, 0x3B, 0x51, 0xD8, 0x81, 0x8E, 0x44, 0xAD, 0x54,
    0xA9, 0x45, 0x42, 0xA5, 0x52, 0xD1, 0x8F, 0x0D, 0x4C, 0x63,
    0x07, 0x93, 0x0C, 0x85, 0xC2, 0xD3, 0x90, 0x7C, 0x5E, 0xDE,
    0x43, 0xDE, 0x2B, 0x38, 0xC9, 0x6D, 0xCE, 0x77, 0xEE, 0x3F,
    0x37, 0x5F, 0x0E, 0x9F, 0xA0, 0x32, 0x06, 0x58, 0x63, 0x84,
    0x4A, 0xF0, 0xD6, 0xC2, 0x1C, 0x4B, 0xB4, 0xD3, 0x00, 0x53,
    0x44, 0xC1, 0xFC, 0xA2, 0x81, 0x2F, 0x1C, 0x03, 0xFF, 0x8C,
    0x31, 0x4A, 0x71, 0xC0, 0x21, 0x06, 0x88, 0x70, 0xC2, 0x36,
    0xC1, 0x8F, 0xB0, 0x43, 0x3D, 0x04, 0x24, 0x85, 0x9E, 0xCD,
    0x3F, 0x3A, 0x50, 0xB8, 0x1A, 0x59, 0xD5, 0xCD, 0x0B, 0xD8,
    0x17, 0x73, 0x2C, 0xC3, 0x39, 0xEF, 0x05, 0xDF, 0x64, 0xFB,
    0xC4, 0x23, 0x7A, 0x37, 0xCA, 0x5F, 0x42, 0xE0, 0x84, 0x4D,
    0xCA, 0xF2, 0x0F, 0x6A, 0xE1, 0x19, 0x93, 0x58, 0xE0, 0x56,
    0xA4, 0xAA, 0x17, 0x8B, 0x54, 0x42, 0x1F, 0x2B, 0x0C, 0xDD,
    0x57, 0xB9, 0x89, 0x19, 0x16, 0x1E, 0x54, 0xF9, 0xBD, 0xBA,
    0x00, 0xCE, 0x45, 0x55, 0xC1, 0x08, 0x9C, 0xBC, 0x95, 0x00,
    0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60,
    0x82,
};
wxBitmap& forward_png_to_wx_bitmap()
{
    static wxMemoryInputStream memIStream( forward_png, sizeof( forward_png ) );
    static wxImage image( memIStream, wxBITMAP_TYPE_PNG );
    static wxBitmap bmp( image );
    return bmp;
}
#endif //FORWARD_PNG_H
ui/embended_files/images.png.h
New file
@@ -0,0 +1,61 @@
#ifndef IMAGES_PNG_H
#define IMAGES_PNG_H
#include <wx/mstream.h>
#include <wx/image.h>
#include <wx/bitmap.h>
static const unsigned char images_png[] =
{
    0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00,
    0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x10,
    0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1F,
    0xF3, 0xFF, 0x61, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59,
    0x73, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x76, 0x01,
    0x4E, 0x7B, 0x26, 0x08, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45,
    0x58, 0x74, 0x53, 0x6F, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65,
    0x00, 0x77, 0x77, 0x77, 0x2E, 0x69, 0x6E, 0x6B, 0x73, 0x63,
    0x61, 0x70, 0x65, 0x2E, 0x6F, 0x72, 0x67, 0x9B, 0xEE, 0x3C,
    0x1A, 0x00, 0x00, 0x01, 0x15, 0x49, 0x44, 0x41, 0x54, 0x38,
    0x8D, 0x95, 0xD3, 0x3B, 0x2F, 0x04, 0x61, 0x14, 0xC6, 0xF1,
    0xDF, 0xBA, 0x96, 0x5B, 0x88, 0x42, 0x21, 0x91, 0x48, 0x44,
    0xDC, 0x7A, 0x35, 0xBD, 0xC2, 0x47, 0x90, 0xB8, 0x86, 0x6F,
    0xB2, 0x85, 0x9E, 0x88, 0xE8, 0x6C, 0x14, 0x3A, 0x71, 0x29,
    0x49, 0x74, 0x3A, 0xB2, 0xA2, 0x12, 0x0A, 0x36, 0x22, 0x21,
    0x1A, 0xD6, 0x2A, 0xF6, 0x4C, 0x62, 0xC7, 0x0C, 0xEB, 0x24,
    0x4F, 0x26, 0xE7, 0x9D, 0xF7, 0xF9, 0xBF, 0xE7, 0x9C, 0x99,
    0x97, 0x9F, 0x31, 0x81, 0x63, 0xBC, 0xA2, 0x9E, 0xA1, 0x1A,
    0xAE, 0x31, 0x9F, 0xE1, 0xD5, 0x8F, 0xE7, 0x1C, 0x63, 0x96,
    0x16, 0xDA, 0x52, 0x80, 0x39, 0x14, 0x51, 0x42, 0x0F, 0x2E,
    0xB3, 0x4E, 0x89, 0x78, 0xC4, 0x59, 0x1A, 0x30, 0x1C, 0xCF,
    0x42, 0xE8, 0x37, 0xF3, 0x14, 0xDE, 0x92, 0x85, 0x64, 0xF3,
    0x6E, 0x46, 0x99, 0x37, 0x38, 0xC2, 0x47, 0xE4, 0x0F, 0x18,
    0xC7, 0x20, 0x6E, 0x13, 0xC0, 0x4A, 0x0E, 0xA0, 0x8C, 0xAE,
    0x78, 0x37, 0x8D, 0x4A, 0xCA, 0x5C, 0x4F, 0x00, 0x95, 0x0C,
    0x40, 0x19, 0x1D, 0x58, 0xC3, 0x39, 0x7A, 0x63, 0xCF, 0xD0,
    0x37, 0x73, 0x5D, 0xD0, 0xEA, 0xE8, 0xC4, 0x76, 0x86, 0xF9,
    0x33, 0xD6, 0xAA, 0x38, 0xD1, 0xFC, 0x79, 0x5F, 0x60, 0x39,
    0x92, 0x51, 0x2C, 0xE5, 0x98, 0xF3, 0x74, 0x08, 0xFB, 0x91,
    0x94, 0xD0, 0x1D, 0xE6, 0xD5, 0x16, 0xCC, 0x4F, 0x18, 0x2B,
    0xE0, 0x1E, 0x7D, 0x31, 0xE5, 0x19, 0x1C, 0x60, 0x11, 0x93,
    0x01, 0x4C, 0x47, 0x0D, 0x57, 0xD8, 0xC0, 0x9D, 0xE8, 0x2D,
    0xA1, 0xBE, 0x47, 0x25, 0x23, 0x31, 0x93, 0x96, 0x62, 0xF3,
    0x8F, 0x52, 0xD3, 0xDA, 0x4A, 0x03, 0x8A, 0x38, 0xFD, 0x07,
    0x60, 0x36, 0xAB, 0x8A, 0x82, 0xC6, 0x8F, 0xB2, 0x1E, 0xFD,
    0xE5, 0x99, 0x2F, 0xD0, 0xDE, 0x4A, 0x5B, 0x03, 0x1A, 0xD7,
    0x75, 0x4F, 0x63, 0xC8, 0x55, 0xEC, 0x68, 0x5C, 0xB0, 0xA6,
    0xF8, 0x02, 0x72, 0x64, 0x87, 0x82, 0x81, 0x5D, 0x07, 0x43,
    0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE, 0x42,
    0x60, 0x82,
};
wxBitmap& images_png_to_wx_bitmap()
{
    static wxMemoryInputStream memIStream( images_png, sizeof( images_png ) );
    static wxImage image( memIStream, wxBITMAP_TYPE_PNG );
    static wxBitmap bmp( image );
    return bmp;
}
#endif //IMAGES_PNG_H
ui/embended_files/palette.png.h
New file
@@ -0,0 +1,68 @@
#ifndef PALETTE_PNG_H
#define PALETTE_PNG_H
#include <wx/mstream.h>
#include <wx/image.h>
#include <wx/bitmap.h>
static const unsigned char palette_png[] =
{
    0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00,
    0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x10,
    0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1F,
    0xF3, 0xFF, 0x61, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59,
    0x73, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x76, 0x01,
    0x4E, 0x7B, 0x26, 0x08, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45,
    0x58, 0x74, 0x53, 0x6F, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65,
    0x00, 0x77, 0x77, 0x77, 0x2E, 0x69, 0x6E, 0x6B, 0x73, 0x63,
    0x61, 0x70, 0x65, 0x2E, 0x6F, 0x72, 0x67, 0x9B, 0xEE, 0x3C,
    0x1A, 0x00, 0x00, 0x01, 0x5E, 0x49, 0x44, 0x41, 0x54, 0x38,
    0x8D, 0x85, 0xD3, 0xBF, 0x4B, 0x57, 0x51, 0x18, 0x06, 0xF0,
    0x8F, 0x7E, 0xA5, 0x28, 0xB4, 0xF1, 0x4B, 0x0D, 0x1A, 0x62,
    0xA3, 0x06, 0x0D, 0x46, 0x41, 0x53, 0xA2, 0xA3, 0xE0, 0x6A,
    0x7F, 0x82, 0xFF, 0x44, 0x4A, 0x41, 0x06, 0x41, 0x41, 0xA8,
    0x65, 0x43, 0x84, 0x50, 0x4B, 0xD0, 0x20, 0x08, 0xA5, 0x63,
    0x0E, 0x8E, 0xD1, 0xE0, 0x26, 0x46, 0x43, 0x2D, 0xE5, 0xA4,
    0xE5, 0x57, 0xFB, 0x36, 0xDC, 0xE7, 0xC6, 0xE5, 0xE6, 0x8F,
    0x07, 0x0E, 0xE7, 0x3C, 0xEF, 0x7D, 0xDE, 0xE7, 0x9C, 0xF7,
    0x3D, 0xE7, 0xF2, 0x3F, 0xAE, 0xE0, 0x11, 0x3E, 0x61, 0x07,
    0x7B, 0xF8, 0x8C, 0xC7, 0x18, 0x3A, 0x42, 0xFF, 0x0F, 0x5D,
    0x98, 0x45, 0x0B, 0xED, 0x63, 0xC6, 0x01, 0x9E, 0xE2, 0x4C,
    0x3D, 0xB9, 0x81, 0x77, 0x11, 0xFD, 0xC6, 0x1C, 0x6E, 0xA2,
    0x1B, 0xE7, 0x30, 0x8C, 0x27, 0xF8, 0x15, 0xCD, 0x1A, 0xCE,
    0x56, 0x0D, 0xEE, 0xE7, 0xC3, 0xB7, 0x88, 0x8F, 0xC3, 0x10,
    0xB6, 0xA3, 0x9D, 0x2F, 0x83, 0xFD, 0x71, 0x6E, 0xE1, 0x3A,
    0x9A, 0xD8, 0xCC, 0x68, 0x46, 0x33, 0x91, 0x7E, 0x2C, 0x62,
    0x10, 0xBB, 0x38, 0xC4, 0x35, 0xB8, 0x1B, 0xC7, 0x17, 0x11,
    0x8F, 0x56, 0x6A, 0x1E, 0x4D, 0x6C, 0x31, 0xFC, 0x67, 0xF8,
    0xC3, 0xF0, 0x05, 0xF8, 0x18, 0x72, 0xBB, 0xD2, 0x8F, 0x19,
    0x4C, 0x67, 0x5D, 0x9E, 0xF2, 0x39, 0xC6, 0xC3, 0x07, 0x93,
    0xB3, 0x05, 0x5F, 0x43, 0x2E, 0x9E, 0x50, 0x7B, 0x1D, 0x0D,
    0xEC, 0xE3, 0xA0, 0x13, 0x7F, 0x6A, 0x1F, 0x9B, 0x18, 0xAB,
    0xEC, 0x5E, 0xE2, 0x12, 0x6E, 0x64, 0xEE, 0xCA, 0xE8, 0x80,
    0xF5, 0x9C, 0x60, 0x24, 0xC2, 0xCD, 0xF0, 0x99, 0xF0, 0x0B,
    0x58, 0x52, 0x34, 0xAD, 0x9D, 0x0D, 0xDF, 0x67, 0xFD, 0xA5,
    0x13, 0x1F, 0x22, 0x9C, 0xCC, 0xDC, 0xAE, 0xCD, 0x4B, 0xB8,
    0xA3, 0x78, 0x1F, 0x1B, 0x8A, 0x1B, 0x28, 0x9B, 0xBB, 0x06,
    0x7D, 0x8A, 0x6B, 0xDC, 0xCF, 0x11, 0x9B, 0x11, 0x34, 0x70,
    0x35, 0x46, 0x3F, 0x30, 0x90, 0xA4, 0x5E, 0xBC, 0xC5, 0x0A,
    0x2E, 0x97, 0xF5, 0xDD, 0x8B, 0xF0, 0xBB, 0xE2, 0x2D, 0x94,
    0x98, 0x4C, 0xFC, 0xB5, 0x53, 0x50, 0x7D, 0xCA, 0x2D, 0x3C,
    0xC3, 0x2D, 0x4C, 0x25, 0xF6, 0xF2, 0x34, 0x83, 0xD2, 0xE4,
    0x41, 0x4A, 0xA9, 0xFF, 0x44, 0xAF, 0x4E, 0x4A, 0x2A, 0xD1,
    0xC6, 0x2A, 0xDE, 0x28, 0x7A, 0xD2, 0x83, 0xF3, 0xD1, 0x6C,
    0x60, 0xF9, 0x28, 0x83, 0xBF, 0x72, 0x9A, 0x66, 0x32, 0x3D,
    0x34, 0xCD, 0x90, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E,
    0x44, 0xAE, 0x42, 0x60, 0x82,
};
wxBitmap& palette_png_to_wx_bitmap()
{
    static wxMemoryInputStream memIStream( palette_png, sizeof( palette_png ) );
    static wxImage image( memIStream, wxBITMAP_TYPE_PNG );
    static wxBitmap bmp( image );
    return bmp;
}
#endif //PALETTE_PNG_H
ui/embended_files/pause.png.h
New file
@@ -0,0 +1,46 @@
#ifndef PAUSE_PNG_H
#define PAUSE_PNG_H
#include <wx/mstream.h>
#include <wx/image.h>
#include <wx/bitmap.h>
static const unsigned char pause_png[] =
{
    0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00,
    0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x10,
    0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1F,
    0xF3, 0xFF, 0x61, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59,
    0x73, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x76, 0x01,
    0x4E, 0x7B, 0x26, 0x08, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45,
    0x58, 0x74, 0x53, 0x6F, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65,
    0x00, 0x77, 0x77, 0x77, 0x2E, 0x69, 0x6E, 0x6B, 0x73, 0x63,
    0x61, 0x70, 0x65, 0x2E, 0x6F, 0x72, 0x67, 0x9B, 0xEE, 0x3C,
    0x1A, 0x00, 0x00, 0x00, 0x85, 0x49, 0x44, 0x41, 0x54, 0x38,
    0x8D, 0xED, 0xD3, 0x3D, 0x0A, 0xC2, 0x40, 0x10, 0x06, 0xD0,
    0x47, 0x2C, 0x94, 0x5C, 0x45, 0x1B, 0x3D, 0x9B, 0x78, 0x1F,
    0x6D, 0xD4, 0xA3, 0xA8, 0xA0, 0xA8, 0x27, 0x11, 0xDB, 0xF8,
    0x53, 0x18, 0x71, 0x1C, 0x12, 0xC1, 0x3E, 0x03, 0x0B, 0xBB,
    0xBC, 0x8F, 0x8F, 0x69, 0x96, 0xCF, 0x8C, 0xB0, 0xC3, 0x05,
    0x73, 0xF4, 0x83, 0x0D, 0xB0, 0xA8, 0x6D, 0x8B, 0xA1, 0x86,
    0xD9, 0xE1, 0x11, 0xCE, 0x34, 0xD8, 0x2C, 0xD9, 0xA6, 0xA9,
    0xA0, 0x4A, 0xA1, 0x65, 0xB0, 0x55, 0xB2, 0xEA, 0x0D, 0x45,
    0x08, 0xF5, 0x52, 0x61, 0x7C, 0x17, 0x6D, 0x96, 0xE1, 0xEF,
    0xE9, 0x0A, 0xBA, 0x82, 0x5C, 0x70, 0x4B, 0x76, 0x6F, 0xB9,
    0x7F, 0x65, 0x63, 0xC1, 0x39, 0x85, 0x8E, 0x3F, 0xEC, 0xD4,
    0xB4, 0xCD, 0x04, 0x07, 0x5C, 0xBD, 0x3E, 0x4F, 0x19, 0xAC,
    0xC4, 0xBA, 0xB6, 0x3D, 0xC6, 0x6F, 0x78, 0x02, 0xA6, 0x85,
    0x23, 0x87, 0x5F, 0x03, 0xA6, 0x1F, 0x00, 0x00, 0x00, 0x00,
    0x49, 0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60, 0x82,
};
wxBitmap& pause_png_to_wx_bitmap()
{
    static wxMemoryInputStream memIStream( pause_png, sizeof( pause_png ) );
    static wxImage image( memIStream, wxBITMAP_TYPE_PNG );
    static wxBitmap bmp( image );
    return bmp;
}
#endif //PAUSE_PNG_H
ui/embended_files/picture.png.h
New file
@@ -0,0 +1,60 @@
#ifndef PICTURE_PNG_H
#define PICTURE_PNG_H
#include <wx/mstream.h>
#include <wx/image.h>
#include <wx/bitmap.h>
static const unsigned char picture_png[] =
{
    0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00,
    0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x10,
    0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1F,
    0xF3, 0xFF, 0x61, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59,
    0x73, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x76, 0x01,
    0x4E, 0x7B, 0x26, 0x08, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45,
    0x58, 0x74, 0x53, 0x6F, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65,
    0x00, 0x77, 0x77, 0x77, 0x2E, 0x69, 0x6E, 0x6B, 0x73, 0x63,
    0x61, 0x70, 0x65, 0x2E, 0x6F, 0x72, 0x67, 0x9B, 0xEE, 0x3C,
    0x1A, 0x00, 0x00, 0x01, 0x13, 0x49, 0x44, 0x41, 0x54, 0x38,
    0x8D, 0x8D, 0xD3, 0xB1, 0x4A, 0x43, 0x41, 0x10, 0x05, 0xD0,
    0x63, 0xF2, 0x0A, 0xBF, 0xC5, 0x94, 0x76, 0x96, 0xF6, 0x16,
    0x0A, 0x41, 0x2B, 0x23, 0xB6, 0xA6, 0x30, 0x56, 0x41, 0x4B,
    0xC5, 0x46, 0x44, 0x14, 0x6C, 0xC4, 0x4E, 0xFF, 0xC0, 0x5A,
    0xB1, 0xF2, 0x07, 0x62, 0xB4, 0x11, 0xB4, 0x4B, 0x6D, 0x29,
    0xC4, 0x3C, 0x8B, 0x9D, 0x48, 0x12, 0x92, 0xF7, 0x72, 0x61,
    0xD9, 0x65, 0x76, 0xEE, 0xDD, 0x3B, 0xBB, 0x3B, 0x24, 0xEC,
    0xA2, 0x8B, 0x3E, 0xF2, 0x92, 0xD1, 0x8F, 0xDC, 0x1D, 0xC8,
    0x82, 0x7C, 0x83, 0x6B, 0x1C, 0xE3, 0x57, 0x31, 0xAA, 0x58,
    0xC1, 0x6D, 0x08, 0xEA, 0xE2, 0xB2, 0x84, 0xB4, 0x8E, 0x7B,
    0x1C, 0x61, 0x31, 0x62, 0x57, 0xE8, 0x08, 0x4B, 0x9B, 0x05,
    0xE4, 0x0D, 0x0C, 0xF0, 0x84, 0x6F, 0xDC, 0x45, 0x7C, 0x0B,
    0xFD, 0x4A, 0x58, 0x1A, 0x14, 0x08, 0xAC, 0xE1, 0x19, 0xAB,
    0x38, 0x0C, 0x41, 0x52, 0xA9, 0xD5, 0x4A, 0x89, 0x75, 0x78,
    0xC3, 0x32, 0xF6, 0xB0, 0x8D, 0xF7, 0xD1, 0xCD, 0x6C, 0x0A,
    0x61, 0x29, 0x4E, 0x85, 0x07, 0xA9, 0xD6, 0x1A, 0x4E, 0xF1,
    0x21, 0x6E, 0x7F, 0x14, 0x39, 0xEA, 0xB1, 0x6E, 0xE2, 0x07,
    0x9F, 0xF8, 0x8A, 0x75, 0x73, 0x86, 0xB3, 0x7A, 0x70, 0xFF,
    0x05, 0x5A, 0xD2, 0x5D, 0xB4, 0xB1, 0x10, 0xA3, 0x1D, 0xB1,
    0x83, 0x32, 0x81, 0xC7, 0x48, 0x6C, 0x4D, 0x49, 0x1C, 0x0A,
    0x4F, 0x8A, 0x8C, 0x09, 0xE4, 0x71, 0xDA, 0x2C, 0xEC, 0x4F,
    0xC9, 0x19, 0x13, 0x38, 0x29, 0x20, 0x4F, 0x3A, 0x19, 0xBA,
    0xAC, 0x23, 0xCF, 0xA4, 0xF7, 0xEC, 0xCC, 0x21, 0x70, 0x11,
    0xF3, 0x79, 0xCC, 0xBD, 0xE0, 0xEA, 0x4A, 0x4F, 0x35, 0x2F,
    0x86, 0x4E, 0x5E, 0xD1, 0xC9, 0x70, 0x26, 0x35, 0x06, 0xBC,
    0x28, 0x6F, 0xA6, 0x9E, 0xF4, 0xB9, 0x6A, 0x68, 0x0C, 0x83,
    0x0D, 0xA9, 0x8C, 0x79, 0xDB, 0xB9, 0x23, 0xFD, 0x4A, 0x7F,
    0xF5, 0xA9, 0x5F, 0x97, 0x48, 0x58, 0x95, 0x86, 0x00, 0x00,
    0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60, 0x82,
};
wxBitmap& picture_png_to_wx_bitmap()
{
    static wxMemoryInputStream memIStream( picture_png, sizeof( picture_png ) );
    static wxImage image( memIStream, wxBITMAP_TYPE_PNG );
    static wxBitmap bmp( image );
    return bmp;
}
#endif //PICTURE_PNG_H
ui/embended_files/play.png.h
New file
@@ -0,0 +1,48 @@
#ifndef PLAY_PNG_H
#define PLAY_PNG_H
#include <wx/mstream.h>
#include <wx/image.h>
#include <wx/bitmap.h>
static const unsigned char play_png[] =
{
    0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00,
    0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x10,
    0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1F,
    0xF3, 0xFF, 0x61, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59,
    0x73, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x76, 0x01,
    0x4E, 0x7B, 0x26, 0x08, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45,
    0x58, 0x74, 0x53, 0x6F, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65,
    0x00, 0x77, 0x77, 0x77, 0x2E, 0x69, 0x6E, 0x6B, 0x73, 0x63,
    0x61, 0x70, 0x65, 0x2E, 0x6F, 0x72, 0x67, 0x9B, 0xEE, 0x3C,
    0x1A, 0x00, 0x00, 0x00, 0x94, 0x49, 0x44, 0x41, 0x54, 0x38,
    0x8D, 0xA5, 0xD3, 0xBD, 0x09, 0x02, 0x41, 0x18, 0x84, 0xE1,
    0x07, 0x03, 0x73, 0x33, 0x2B, 0xD1, 0x12, 0xAC, 0xE5, 0x3A,
    0xD0, 0x32, 0xEC, 0xC0, 0x0A, 0x6C, 0x40, 0xC4, 0x48, 0x8B,
    0xF0, 0x27, 0xD7, 0x58, 0x10, 0x41, 0x74, 0x8D, 0x2E, 0x50,
    0xEE, 0x76, 0xF7, 0x6E, 0x07, 0x26, 0x9C, 0x37, 0x98, 0x6F,
    0x3E, 0x7E, 0x55, 0xE1, 0x84, 0x27, 0x76, 0x98, 0xEA, 0xA0,
    0x0A, 0xE1, 0xCF, 0x2F, 0xCC, 0x31, 0xC8, 0x01, 0x9C, 0x1B,
    0x00, 0xB5, 0x37, 0x18, 0xA7, 0x00, 0xEF, 0x08, 0x20, 0xE0,
    0x8A, 0x59, 0x0C, 0x10, 0x0B, 0xD7, 0xFE, 0x60, 0x89, 0x61,
    0x5F, 0x40, 0xED, 0x3D, 0x46, 0x25, 0x80, 0x80, 0x55, 0x29,
    0xE0, 0x4E, 0xE6, 0x79, 0x5A, 0x14, 0x4A, 0x01, 0xEB, 0x26,
    0x62, 0xAE, 0x0F, 0x7A, 0x96, 0x18, 0x3D, 0x63, 0x6A, 0x48,
    0x37, 0x89, 0x21, 0x5D, 0x22, 0xE1, 0xAC, 0x29, 0xB7, 0x3D,
    0xD3, 0x42, 0x87, 0xB2, 0x2B, 0x1C, 0xF1, 0xC0, 0x16, 0x93,
    0x54, 0xE0, 0x0B, 0xE3, 0x18, 0x7B, 0x8D, 0xDC, 0x34, 0x3E,
    0xB5, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE,
    0x42, 0x60, 0x82,
};
wxBitmap& play_png_to_wx_bitmap()
{
    static wxMemoryInputStream memIStream( play_png, sizeof( play_png ) );
    static wxImage image( memIStream, wxBITMAP_TYPE_PNG );
    static wxBitmap bmp( image );
    return bmp;
}
#endif //PLAY_PNG_H
ui/embended_files/refresh.png.h
New file
@@ -0,0 +1,61 @@
#ifndef REFRESH_PNG_H
#define REFRESH_PNG_H
#include <wx/mstream.h>
#include <wx/image.h>
#include <wx/bitmap.h>
static const unsigned char refresh_png[] =
{
    0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00,
    0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x10,
    0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1F,
    0xF3, 0xFF, 0x61, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59,
    0x73, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x76, 0x01,
    0x4E, 0x7B, 0x26, 0x08, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45,
    0x58, 0x74, 0x53, 0x6F, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65,
    0x00, 0x77, 0x77, 0x77, 0x2E, 0x69, 0x6E, 0x6B, 0x73, 0x63,
    0x61, 0x70, 0x65, 0x2E, 0x6F, 0x72, 0x67, 0x9B, 0xEE, 0x3C,
    0x1A, 0x00, 0x00, 0x01, 0x16, 0x49, 0x44, 0x41, 0x54, 0x38,
    0x8D, 0x9D, 0xD3, 0xBB, 0x4A, 0x43, 0x41, 0x10, 0x06, 0xE0,
    0x8F, 0xE0, 0x35, 0x88, 0x22, 0x3E, 0x85, 0x78, 0x97, 0x80,
    0x85, 0x20, 0x36, 0x16, 0xDA, 0xA4, 0xB3, 0xB7, 0xF1, 0x39,
    0xF2, 0x06, 0x82, 0xC1, 0xEB, 0x9B, 0xD8, 0x44, 0xF0, 0x15,
    0x44, 0xB1, 0xB1, 0xD0, 0xCE, 0x36, 0x48, 0x42, 0x88, 0x31,
    0x16, 0x3B, 0x27, 0x1C, 0x35, 0x17, 0xC8, 0x0F, 0x87, 0xD9,
    0x5D, 0xE6, 0xFF, 0x77, 0xE6, 0xEC, 0x3F, 0xFC, 0xC7, 0x06,
    0x2E, 0xF0, 0x82, 0x36, 0x5A, 0x78, 0x46, 0x15, 0xAB, 0x7F,
    0x72, 0xE7, 0xF2, 0x9B, 0x22, 0x6E, 0xF1, 0x8D, 0xEE, 0x80,
    0xAF, 0x13, 0x42, 0x53, 0xA8, 0xA0, 0x9C, 0x91, 0x67, 0xF1,
    0x10, 0x49, 0x4D, 0x9C, 0xA1, 0x14, 0xA2, 0x45, 0xEC, 0x04,
    0xB1, 0x15, 0x39, 0xAF, 0x11, 0x7B, 0x02, 0x37, 0x71, 0xF0,
    0x8E, 0xB5, 0x3E, 0x6D, 0x65, 0xD8, 0x42, 0x3D, 0x57, 0x51,
    0x19, 0x36, 0xA3, 0xB4, 0xE6, 0x08, 0xB2, 0x28, 0x3B, 0xDF,
    0xD2, 0xC1, 0x04, 0x4E, 0x51, 0xC0, 0x35, 0x1E, 0x87, 0x90,
    0xE7, 0xF1, 0x84, 0xE3, 0xD8, 0x37, 0x70, 0x4F, 0xFA, 0xDB,
    0xDD, 0xE8, 0x79, 0x2C, 0x34, 0x43, 0xA0, 0x38, 0xAE, 0xC0,
    0x38, 0x58, 0x8C, 0x4B, 0x3F, 0x0B, 0x63, 0x0A, 0x2C, 0x47,
    0x7C, 0x9B, 0xC0, 0x34, 0x0E, 0x31, 0x99, 0x4B, 0xB8, 0x93,
    0x9E, 0x6B, 0x10, 0x4E, 0x22, 0xD6, 0xE0, 0xC8, 0xEF, 0xA7,
    0xA9, 0x8C, 0xB8, 0xBD, 0x24, 0x19, 0xAA, 0x83, 0x75, 0x92,
    0x19, 0x32, 0x72, 0x1D, 0xBB, 0x43, 0xC8, 0xDB, 0xF8, 0x88,
    0xDC, 0xAB, 0xEC, 0x30, 0x13, 0xC8, 0xEC, 0xD9, 0x96, 0x9C,
    0xB9, 0x87, 0x25, 0x2C, 0x60, 0x5F, 0x1A, 0xB0, 0xAF, 0xC8,
    0xA9, 0x61, 0x26, 0x2F, 0x50, 0x91, 0x06, 0xE4, 0x3C, 0x4A,
    0x1B, 0x36, 0x4C, 0x97, 0xD2, 0xEC, 0xF4, 0xF0, 0x6B, 0x24,
    0xB1, 0x12, 0x42, 0x4F, 0x92, 0x47, 0x1A, 0xB1, 0xAE, 0xEA,
    0x63, 0xF5, 0x1F, 0x67, 0xAD, 0x56, 0xFD, 0xBC, 0x3E, 0x67,
    0x79, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE,
    0x42, 0x60, 0x82,
};
wxBitmap& refresh_png_to_wx_bitmap()
{
    static wxMemoryInputStream memIStream( refresh_png, sizeof( refresh_png ) );
    static wxImage image( memIStream, wxBITMAP_TYPE_PNG );
    static wxBitmap bmp( image );
    return bmp;
}
#endif //REFRESH_PNG_H
ui/embended_files/replace.png.h
New file
@@ -0,0 +1,62 @@
#ifndef REPLACE_PNG_H
#define REPLACE_PNG_H
#include <wx/mstream.h>
#include <wx/image.h>
#include <wx/bitmap.h>
static const unsigned char replace_png[] =
{
    0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00,
    0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x10,
    0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1F,
    0xF3, 0xFF, 0x61, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59,
    0x73, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x76, 0x01,
    0x4E, 0x7B, 0x26, 0x08, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45,
    0x58, 0x74, 0x53, 0x6F, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65,
    0x00, 0x77, 0x77, 0x77, 0x2E, 0x69, 0x6E, 0x6B, 0x73, 0x63,
    0x61, 0x70, 0x65, 0x2E, 0x6F, 0x72, 0x67, 0x9B, 0xEE, 0x3C,
    0x1A, 0x00, 0x00, 0x01, 0x1E, 0x49, 0x44, 0x41, 0x54, 0x38,
    0x8D, 0x95, 0xD2, 0xAD, 0x4E, 0x03, 0x41, 0x14, 0x86, 0xE1,
    0xA7, 0x2D, 0x25, 0x21, 0xA0, 0x51, 0x98, 0x0A, 0x52, 0x6C,
    0x1D, 0x45, 0x20, 0x08, 0x20, 0xEA, 0xF8, 0xE9, 0x15, 0x00,
    0xB7, 0x80, 0x22, 0x81, 0x04, 0x45, 0x02, 0xB7, 0x81, 0x41,
    0xC0, 0x0D, 0x10, 0x64, 0x11, 0x08, 0x1C, 0x02, 0x81, 0xA0,
    0x69, 0x05, 0x86, 0xDF, 0xE0, 0xBA, 0x88, 0x9D, 0x26, 0xB3,
    0x0B, 0x0B, 0xE5, 0x4B, 0x4E, 0xB2, 0x73, 0x66, 0xCF, 0x7B,
    0xBE, 0x33, 0x33, 0xD0, 0xC2, 0x23, 0x92, 0x28, 0xDE, 0x71,
    0x22, 0xAB, 0x3A, 0xF6, 0x73, 0x39, 0xA5, 0x50, 0x7C, 0x83,
    0xD3, 0x28, 0x5F, 0xC3, 0x11, 0x9A, 0xB8, 0x0E, 0xC5, 0x57,
    0x78, 0xC0, 0x32, 0x3E, 0x63, 0x48, 0x82, 0x76, 0x9E, 0x1C,
    0xE5, 0xA7, 0xD1, 0xC3, 0x33, 0xB6, 0xB0, 0x81, 0xB9, 0xFF,
    0x00, 0x56, 0x73, 0xE3, 0x25, 0x18, 0xE0, 0x70, 0x54, 0x40,
    0x05, 0xE7, 0x78, 0xC5, 0x02, 0xCA, 0xC1, 0xC9, 0x00, 0xB3,
    0xA3, 0x00, 0xA0, 0x1A, 0x20, 0x7D, 0x4C, 0x04, 0x68, 0x82,
    0xF5, 0xE1, 0x8F, 0x45, 0x11, 0x83, 0xAB, 0x68, 0xE4, 0x1B,
    0x94, 0x0A, 0xBA, 0x0F, 0xD5, 0x41, 0xB7, 0x60, 0xAF, 0x8D,
    0x4E, 0x09, 0x33, 0xD2, 0xEB, 0x3A, 0xFB, 0x05, 0x34, 0x85,
    0x45, 0x4C, 0x46, 0xB9, 0x6E, 0x68, 0x60, 0x33, 0xD8, 0x19,
    0xAA, 0x81, 0xF1, 0x5C, 0xF1, 0x9D, 0x9F, 0x47, 0x3C, 0x86,
    0xB5, 0xB0, 0xA8, 0x48, 0x0F, 0xA8, 0x8F, 0x8B, 0x08, 0xD2,
    0x0A, 0xFB, 0xB5, 0x9C, 0xAB, 0x5D, 0xBC, 0x91, 0x5E, 0xC5,
    0x00, 0x3B, 0x01, 0xD2, 0xC4, 0x4B, 0x80, 0x54, 0xC2, 0xAC,
    0x89, 0xEF, 0xCA, 0xE4, 0x0F, 0x02, 0x24, 0x6F, 0x71, 0xE5,
    0x2F, 0x40, 0x39, 0x02, 0xD4, 0xA5, 0xCF, 0x74, 0x3B, 0x38,
    0xE8, 0xE1, 0xF6, 0x87, 0xC2, 0x8C, 0xC6, 0xA2, 0xEF, 0x7B,
    0xE9, 0xC9, 0x5E, 0xE2, 0x03, 0x4B, 0x78, 0xCA, 0x75, 0x8C,
    0x35, 0x5F, 0x04, 0xDD, 0x0B, 0x6E, 0x32, 0x56, 0x8B, 0xE2,
    0x0B, 0x5B, 0x74, 0x63, 0x32, 0xCA, 0x62, 0x48, 0x86, 0x00,
    0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60,
    0x82,
};
wxBitmap& replace_png_to_wx_bitmap()
{
    static wxMemoryInputStream memIStream( replace_png, sizeof( replace_png ) );
    static wxImage image( memIStream, wxBITMAP_TYPE_PNG );
    static wxBitmap bmp( image );
    return bmp;
}
#endif //REPLACE_PNG_H
ui/embended_files/rotate-right.png.h
New file
@@ -0,0 +1,60 @@
#ifndef ROTATE-RIGHT_PNG_H
#define ROTATE-RIGHT_PNG_H
#include <wx/mstream.h>
#include <wx/image.h>
#include <wx/bitmap.h>
static const unsigned char rotate-right_png[] =
{
    0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00,
    0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x10,
    0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1F,
    0xF3, 0xFF, 0x61, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59,
    0x73, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x76, 0x01,
    0x4E, 0x7B, 0x26, 0x08, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45,
    0x58, 0x74, 0x53, 0x6F, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65,
    0x00, 0x77, 0x77, 0x77, 0x2E, 0x69, 0x6E, 0x6B, 0x73, 0x63,
    0x61, 0x70, 0x65, 0x2E, 0x6F, 0x72, 0x67, 0x9B, 0xEE, 0x3C,
    0x1A, 0x00, 0x00, 0x01, 0x0A, 0x49, 0x44, 0x41, 0x54, 0x38,
    0x8D, 0xA5, 0xD3, 0xCF, 0x2A, 0x84, 0x51, 0x1C, 0xC6, 0xF1,
    0xCF, 0x4C, 0x26, 0x73, 0x19, 0x48, 0xF1, 0xFA, 0x93, 0xB2,
    0xB5, 0x91, 0x85, 0x8D, 0x14, 0x89, 0x28, 0xB7, 0xC0, 0x0D,
    0x58, 0xD8, 0x09, 0x0B, 0x22, 0x57, 0x61, 0xA1, 0x2C, 0x49,
    0x73, 0x03, 0x22, 0x44, 0xC9, 0x46, 0x56, 0x6C, 0xFC, 0x5D,
    0x90, 0x32, 0xB1, 0x78, 0xCF, 0xAB, 0xB7, 0x77, 0xC6, 0x34,
    0x33, 0x9E, 0x3A, 0x9D, 0x7A, 0xCE, 0xF9, 0x3E, 0xBF, 0xDF,
    0xA9, 0xF3, 0xA3, 0x52, 0x11, 0x36, 0x71, 0x86, 0x27, 0xBC,
    0xE0, 0x3C, 0x78, 0x3D, 0xE1, 0xCE, 0x5A, 0x58, 0x5A, 0x52,
    0x60, 0x21, 0x98, 0x0B, 0xB8, 0xC6, 0x7E, 0xD8, 0x73, 0x21,
    0x74, 0x12, 0x8B, 0xD8, 0x41, 0x1B, 0x3E, 0x65, 0xE0, 0x03,
    0x3C, 0x62, 0x26, 0x40, 0x59, 0xE5, 0x30, 0x8F, 0x57, 0x7C,
    0x63, 0x37, 0xDD, 0xC1, 0x3A, 0x06, 0x31, 0x14, 0xAA, 0x56,
    0xD3, 0x2A, 0xDA, 0x71, 0x8B, 0x01, 0x7C, 0x24, 0x01, 0x51,
    0x68, 0x7B, 0xAA, 0x06, 0x9C, 0xD6, 0x0D, 0x2E, 0xB0, 0x92,
    0x18, 0x1B, 0x38, 0xA9, 0x03, 0xAC, 0xAA, 0x3C, 0x46, 0xB0,
    0xF7, 0x9F, 0x80, 0x0E, 0xF5, 0xB5, 0xFE, 0x67, 0x40, 0xB3,
    0x1A, 0xC5, 0x69, 0x1E, 0x77, 0xE8, 0x6A, 0x22, 0x60, 0x18,
    0x85, 0x3C, 0x8E, 0x30, 0xD1, 0x20, 0x9C, 0x0B, 0x4C, 0x09,
    0xBA, 0xF1, 0x85, 0xB1, 0x06, 0x02, 0xE6, 0x02, 0xD3, 0x9F,
    0x18, 0x5B, 0xB8, 0x47, 0x67, 0x1D, 0x70, 0x2F, 0x9E, 0xC5,
    0x5F, 0xFA, 0x57, 0x45, 0x1C, 0xE2, 0x01, 0xE3, 0x35, 0xE0,
    0x69, 0xF1, 0x80, 0x95, 0xD0, 0x9A, 0x3D, 0x2C, 0x62, 0x1B,
    0x65, 0x1C, 0x63, 0x09, 0xB3, 0xE2, 0xD9, 0x58, 0x16, 0x4F,
    0x64, 0x39, 0x54, 0xAE, 0x80, 0xD3, 0x8A, 0xC4, 0x4F, 0xBA,
    0xC4, 0x3B, 0xDE, 0x70, 0x15, 0xC2, 0xFB, 0xB2, 0x97, 0x7F,
    0x00, 0x47, 0x97, 0x36, 0xEB, 0xDA, 0xB5, 0x81, 0xFA, 0x00,
    0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60,
    0x82,
};
wxBitmap& rotate-right_png_to_wx_bitmap()
{
    static wxMemoryInputStream memIStream( rotate-right_png, sizeof( rotate-right_png ) );
    static wxImage image( memIStream, wxBITMAP_TYPE_PNG );
    static wxBitmap bmp( image );
    return bmp;
}
#endif //ROTATE-RIGHT_PNG_H
ui/embended_files/rotate_right.png.h
New file
@@ -0,0 +1,60 @@
#ifndef ROTATE_RIGHT_PNG_H
#define ROTATE_RIGHT_PNG_H
#include <wx/mstream.h>
#include <wx/image.h>
#include <wx/bitmap.h>
static const unsigned char rotate_right_png[] =
{
    0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00,
    0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x10,
    0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1F,
    0xF3, 0xFF, 0x61, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59,
    0x73, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x76, 0x01,
    0x4E, 0x7B, 0x26, 0x08, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45,
    0x58, 0x74, 0x53, 0x6F, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65,
    0x00, 0x77, 0x77, 0x77, 0x2E, 0x69, 0x6E, 0x6B, 0x73, 0x63,
    0x61, 0x70, 0x65, 0x2E, 0x6F, 0x72, 0x67, 0x9B, 0xEE, 0x3C,
    0x1A, 0x00, 0x00, 0x01, 0x0A, 0x49, 0x44, 0x41, 0x54, 0x38,
    0x8D, 0xA5, 0xD3, 0xCF, 0x2A, 0x84, 0x51, 0x1C, 0xC6, 0xF1,
    0xCF, 0x4C, 0x26, 0x73, 0x19, 0x48, 0xF1, 0xFA, 0x93, 0xB2,
    0xB5, 0x91, 0x85, 0x8D, 0x14, 0x89, 0x28, 0xB7, 0xC0, 0x0D,
    0x58, 0xD8, 0x09, 0x0B, 0x22, 0x57, 0x61, 0xA1, 0x2C, 0x49,
    0x73, 0x03, 0x22, 0x44, 0xC9, 0x46, 0x56, 0x6C, 0xFC, 0x5D,
    0x90, 0x32, 0xB1, 0x78, 0xCF, 0xAB, 0xB7, 0x77, 0xC6, 0x34,
    0x33, 0x9E, 0x3A, 0x9D, 0x7A, 0xCE, 0xF9, 0x3E, 0xBF, 0xDF,
    0xA9, 0xF3, 0xA3, 0x52, 0x11, 0x36, 0x71, 0x86, 0x27, 0xBC,
    0xE0, 0x3C, 0x78, 0x3D, 0xE1, 0xCE, 0x5A, 0x58, 0x5A, 0x52,
    0x60, 0x21, 0x98, 0x0B, 0xB8, 0xC6, 0x7E, 0xD8, 0x73, 0x21,
    0x74, 0x12, 0x8B, 0xD8, 0x41, 0x1B, 0x3E, 0x65, 0xE0, 0x03,
    0x3C, 0x62, 0x26, 0x40, 0x59, 0xE5, 0x30, 0x8F, 0x57, 0x7C,
    0x63, 0x37, 0xDD, 0xC1, 0x3A, 0x06, 0x31, 0x14, 0xAA, 0x56,
    0xD3, 0x2A, 0xDA, 0x71, 0x8B, 0x01, 0x7C, 0x24, 0x01, 0x51,
    0x68, 0x7B, 0xAA, 0x06, 0x9C, 0xD6, 0x0D, 0x2E, 0xB0, 0x92,
    0x18, 0x1B, 0x38, 0xA9, 0x03, 0xAC, 0xAA, 0x3C, 0x46, 0xB0,
    0xF7, 0x9F, 0x80, 0x0E, 0xF5, 0xB5, 0xFE, 0x67, 0x40, 0xB3,
    0x1A, 0xC5, 0x69, 0x1E, 0x77, 0xE8, 0x6A, 0x22, 0x60, 0x18,
    0x85, 0x3C, 0x8E, 0x30, 0xD1, 0x20, 0x9C, 0x0B, 0x4C, 0x09,
    0xBA, 0xF1, 0x85, 0xB1, 0x06, 0x02, 0xE6, 0x02, 0xD3, 0x9F,
    0x18, 0x5B, 0xB8, 0x47, 0x67, 0x1D, 0x70, 0x2F, 0x9E, 0xC5,
    0x5F, 0xFA, 0x57, 0x45, 0x1C, 0xE2, 0x01, 0xE3, 0x35, 0xE0,
    0x69, 0xF1, 0x80, 0x95, 0xD0, 0x9A, 0x3D, 0x2C, 0x62, 0x1B,
    0x65, 0x1C, 0x63, 0x09, 0xB3, 0xE2, 0xD9, 0x58, 0x16, 0x4F,
    0x64, 0x39, 0x54, 0xAE, 0x80, 0xD3, 0x8A, 0xC4, 0x4F, 0xBA,
    0xC4, 0x3B, 0xDE, 0x70, 0x15, 0xC2, 0xFB, 0xB2, 0x97, 0x7F,
    0x00, 0x47, 0x97, 0x36, 0xEB, 0xDA, 0xB5, 0x81, 0xFA, 0x00,
    0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60,
    0x82,
};
wxBitmap& rotate_right_png_to_wx_bitmap()
{
    static wxMemoryInputStream memIStream( rotate_right_png, sizeof( rotate_right_png ) );
    static wxImage image( memIStream, wxBITMAP_TYPE_PNG );
    static wxBitmap bmp( image );
    return bmp;
}
#endif //ROTATE_RIGHT_PNG_H
ui/embended_files/settings.png.h
New file
@@ -0,0 +1,62 @@
#ifndef SETTINGS_PNG_H
#define SETTINGS_PNG_H
#include <wx/mstream.h>
#include <wx/image.h>
#include <wx/bitmap.h>
static const unsigned char settings_png[] =
{
    0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00,
    0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x10,
    0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1F,
    0xF3, 0xFF, 0x61, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59,
    0x73, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x76, 0x01,
    0x4E, 0x7B, 0x26, 0x08, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45,
    0x58, 0x74, 0x53, 0x6F, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65,
    0x00, 0x77, 0x77, 0x77, 0x2E, 0x69, 0x6E, 0x6B, 0x73, 0x63,
    0x61, 0x70, 0x65, 0x2E, 0x6F, 0x72, 0x67, 0x9B, 0xEE, 0x3C,
    0x1A, 0x00, 0x00, 0x01, 0x24, 0x49, 0x44, 0x41, 0x54, 0x38,
    0x8D, 0x85, 0xD3, 0xBB, 0x2E, 0x44, 0x61, 0x14, 0x05, 0xE0,
    0x6F, 0x06, 0x41, 0xE7, 0x01, 0x28, 0x48, 0x68, 0x54, 0x74,
    0x1E, 0xC4, 0x2B, 0x30, 0x6E, 0x8D, 0x56, 0xA9, 0x17, 0x0D,
    0x71, 0x49, 0x46, 0x46, 0x3C, 0x83, 0x67, 0x50, 0x8E, 0xA1,
    0xF7, 0x10, 0x6E, 0x89, 0x88, 0x51, 0x9C, 0x35, 0xE3, 0x0C,
    0x67, 0xC6, 0x4E, 0x76, 0xF2, 0x9F, 0xB5, 0xD7, 0xDA, 0xE7,
    0xDF, 0x97, 0xBF, 0x66, 0xB8, 0x75, 0x7F, 0x7D, 0xD7, 0xAA,
    0x48, 0xF5, 0x11, 0x09, 0xE0, 0x28, 0x3E, 0xD4, 0x7A, 0x09,
    0x66, 0x71, 0x80, 0x69, 0x4C, 0x62, 0x2F, 0xF8, 0x5D, 0x5C,
    0xB0, 0xC9, 0x70, 0x0E, 0xA2, 0xE9, 0xDB, 0x4D, 0xAE, 0xFC,
    0x84, 0x07, 0xBC, 0xA2, 0x89, 0xF9, 0xF8, 0x55, 0xB0, 0x4E,
    0x38, 0xDD, 0x68, 0xC0, 0x1A, 0xBE, 0xB0, 0x8D, 0x6B, 0x3C,
    0x62, 0xB1, 0xE2, 0xB6, 0x8B, 0x89, 0xB5, 0xB0, 0x15, 0xCD,
    0x1A, 0xDC, 0xE2, 0x13, 0x0D, 0x8C, 0xC5, 0x61, 0x05, 0x17,
    0x38, 0xCB, 0x59, 0x29, 0xDE, 0x88, 0xE6, 0x16, 0x66, 0x14,
    0x8D, 0xFA, 0xC4, 0x61, 0x49, 0xFC, 0x9E, 0x72, 0xDA, 0x39,
    0xAF, 0x26, 0x76, 0x18, 0xEE, 0x51, 0xB4, 0x7D, 0x7B, 0xC1,
    0x46, 0xCE, 0x67, 0xB9, 0xEE, 0xB8, 0xA2, 0xD1, 0x6D, 0x9C,
    0x26, 0xB6, 0x89, 0xE7, 0x9E, 0x68, 0xD4, 0x18, 0x6B, 0xA9,
    0xB3, 0x8E, 0x09, 0x7C, 0x54, 0x91, 0xEA, 0xA5, 0x12, 0xA6,
    0x30, 0x17, 0xFC, 0x1C, 0x0B, 0x29, 0xE1, 0x5E, 0x31, 0x89,
    0xCB, 0xC4, 0x66, 0x15, 0xA3, 0xEC, 0x97, 0x30, 0xAA, 0x89,
    0x27, 0x38, 0xC6, 0x72, 0xB0, 0x5E, 0x7C, 0x53, 0xA9, 0x89,
    0xE5, 0x31, 0xB6, 0xF2, 0xD7, 0xAA, 0x31, 0x2E, 0x29, 0xFA,
    0x72, 0x8D, 0x1D, 0xA5, 0x31, 0x32, 0xB8, 0x48, 0x1D, 0xBC,
    0x19, 0x5C, 0xA4, 0x66, 0xB0, 0xCA, 0x45, 0xEA, 0xD5, 0x55,
    0x5E, 0xE5, 0xDD, 0x90, 0xD6, 0xE3, 0xDD, 0x60, 0x7F, 0x56,
    0xB9, 0xF2, 0x85, 0xC5, 0xBA, 0x7E, 0x1E, 0xD2, 0xFE, 0x30,
    0xEE, 0x7F, 0x09, 0xFE, 0xE5, 0x7E, 0x03, 0x52, 0x38, 0x4E,
    0xAF, 0x8A, 0x7A, 0x49, 0x82, 0x00, 0x00, 0x00, 0x00, 0x49,
    0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60, 0x82,
};
wxBitmap& settings_png_to_wx_bitmap()
{
    static wxMemoryInputStream memIStream( settings_png, sizeof( settings_png ) );
    static wxImage image( memIStream, wxBITMAP_TYPE_PNG );
    static wxBitmap bmp( image );
    return bmp;
}
#endif //SETTINGS_PNG_H
ui/embended_files/text_box_dots.png.h
New file
@@ -0,0 +1,55 @@
#ifndef TEXT_BOX_DOTS_PNG_H
#define TEXT_BOX_DOTS_PNG_H
#include <wx/mstream.h>
#include <wx/image.h>
#include <wx/bitmap.h>
static const unsigned char text_box_dots_png[] =
{
    0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00,
    0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x10,
    0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1F,
    0xF3, 0xFF, 0x61, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59,
    0x73, 0x00, 0x00, 0x09, 0xD7, 0x00, 0x00, 0x09, 0xD7, 0x01,
    0xB1, 0x6E, 0x17, 0xB7, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45,
    0x58, 0x74, 0x53, 0x6F, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65,
    0x00, 0x77, 0x77, 0x77, 0x2E, 0x69, 0x6E, 0x6B, 0x73, 0x63,
    0x61, 0x70, 0x65, 0x2E, 0x6F, 0x72, 0x67, 0x9B, 0xEE, 0x3C,
    0x1A, 0x00, 0x00, 0x00, 0xDC, 0x49, 0x44, 0x41, 0x54, 0x38,
    0x8D, 0xCD, 0xD2, 0x31, 0x4A, 0x03, 0x61, 0x10, 0x05, 0xE0,
    0x6F, 0x93, 0x60, 0x4A, 0x3D, 0x86, 0xF6, 0x56, 0x6A, 0x65,
    0xE5, 0x09, 0x8C, 0x95, 0x88, 0x8D, 0xD8, 0x46, 0xB0, 0xB0,
    0xF5, 0x06, 0x11, 0x45, 0x24, 0x47, 0xB1, 0x0C, 0x56, 0x16,
    0x82, 0x11, 0xBC, 0x80, 0x87, 0x50, 0x76, 0x8D, 0xC5, 0x4C,
    0x60, 0x11, 0xDC, 0xDD, 0x2A, 0xF8, 0x60, 0x9A, 0xFF, 0x7F,
    0xFF, 0x9B, 0xF7, 0xBF, 0x19, 0xFE, 0x0B, 0x4E, 0xF1, 0x86,
    0x12, 0x8B, 0x96, 0x2A, 0x93, 0x7B, 0x02, 0x83, 0x7C, 0xFC,
    0x80, 0x5B, 0x5C, 0xA3, 0x6A, 0x69, 0xD6, 0xC7, 0x0E, 0xA6,
    0x50, 0xA4, 0xDA, 0x23, 0x2E, 0x71, 0x80, 0xB5, 0x1A, 0xF9,
    0x03, 0x4F, 0x7F, 0x08, 0x4D, 0xB0, 0x2F, 0x2D, 0x8D, 0xB0,
    0x8D, 0xCF, 0x5F, 0x76, 0xDF, 0x1B, 0x9C, 0x1C, 0xA1, 0xEC,
    0xA5, 0xA5, 0x6F, 0x3C, 0x63, 0x88, 0xC3, 0x24, 0x14, 0xD8,
    0x6C, 0x10, 0xA8, 0xD0, 0xEF, 0x35, 0x10, 0x3A, 0x61, 0x25,
    0x02, 0x17, 0x18, 0x63, 0x03, 0xF7, 0xD8, 0xAB, 0x5F, 0x0E,
    0xC4, 0x5F, 0xEA, 0x42, 0x5F, 0x59, 0x4B, 0x5C, 0x89, 0x8C,
    0x5E, 0x70, 0x26, 0xC2, 0x9D, 0x89, 0xEC, 0x2A, 0x62, 0x8C,
    0x93, 0xDA, 0x83, 0xA1, 0x98, 0xC8, 0x12, 0x5B, 0x22, 0xCC,
    0x42, 0x8C, 0x6D, 0x3D, 0xCF, 0x6F, 0xF0, 0x5A, 0x88, 0x8D,
    0x9A, 0xE2, 0x4E, 0xCC, 0xBC, 0xCB, 0x22, 0xED, 0xE2, 0x5C,
    0x2C, 0x21, 0x29, 0x32, 0xD7, 0x7D, 0x95, 0xE7, 0x38, 0x6E,
    0x69, 0xB4, 0x22, 0xFC, 0x00, 0x4C, 0x1D, 0x3E, 0xB6, 0x99,
    0xDB, 0xC3, 0xCE, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E,
    0x44, 0xAE, 0x42, 0x60, 0x82,
};
wxBitmap& text_box_dots_png_to_wx_bitmap()
{
    static wxMemoryInputStream memIStream( text_box_dots_png, sizeof( text_box_dots_png ) );
    static wxImage image( memIStream, wxBITMAP_TYPE_PNG );
    static wxBitmap bmp( image );
    return bmp;
}
#endif //TEXT_BOX_DOTS_PNG_H
ui/embended_files/trash.png.h
New file
@@ -0,0 +1,49 @@
#ifndef TRASH_PNG_H
#define TRASH_PNG_H
#include <wx/mstream.h>
#include <wx/image.h>
#include <wx/bitmap.h>
static const unsigned char trash_png[] =
{
    0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00,
    0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x10,
    0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1F,
    0xF3, 0xFF, 0x61, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59,
    0x73, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x76, 0x01,
    0x4E, 0x7B, 0x26, 0x08, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45,
    0x58, 0x74, 0x53, 0x6F, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65,
    0x00, 0x77, 0x77, 0x77, 0x2E, 0x69, 0x6E, 0x6B, 0x73, 0x63,
    0x61, 0x70, 0x65, 0x2E, 0x6F, 0x72, 0x67, 0x9B, 0xEE, 0x3C,
    0x1A, 0x00, 0x00, 0x00, 0x9C, 0x49, 0x44, 0x41, 0x54, 0x38,
    0x8D, 0xB5, 0x92, 0xD1, 0x0D, 0x82, 0x30, 0x14, 0x45, 0x4F,
    0x94, 0x19, 0xF8, 0xF2, 0xDF, 0x15, 0x20, 0xBA, 0x46, 0x59,
    0x8A, 0xB8, 0x48, 0x49, 0x58, 0x03, 0x46, 0xE0, 0x5B, 0xD9,
    0x80, 0x01, 0xF4, 0xC3, 0xD7, 0x04, 0x1E, 0xAD, 0xB4, 0xA2,
    0x37, 0xB9, 0xC9, 0x4D, 0x5F, 0xEE, 0x49, 0xD3, 0x3E, 0x58,
    0x2B, 0x07, 0x06, 0xE0, 0xA9, 0x3C, 0xC8, 0x6C, 0xA1, 0xCC,
    0x03, 0xB8, 0x02, 0x67, 0xA0, 0x52, 0xE7, 0x56, 0x66, 0xAD,
    0x0F, 0x50, 0x02, 0x27, 0xC9, 0x85, 0x07, 0xEA, 0x74, 0x01,
    0x8E, 0x92, 0x47, 0xA0, 0x9B, 0xD3, 0xF5, 0x95, 0xB7, 0x6C,
    0x35, 0xDD, 0x24, 0x94, 0x8D, 0x2B, 0x1D, 0x3E, 0x5C, 0x37,
    0x4A, 0x7F, 0x05, 0x54, 0x40, 0x2F, 0xD6, 0x3F, 0x12, 0x05,
    0x68, 0x80, 0x87, 0xB8, 0xF9, 0x06, 0x10, 0xA5, 0xDD, 0x00,
    0xDF, 0x26, 0x3A, 0x59, 0xDE, 0x0B, 0xE6, 0x72, 0x32, 0xC0,
    0x04, 0xF2, 0x42, 0x3F, 0x7D, 0x83, 0x31, 0xA1, 0x77, 0x0F,
    0x0D, 0x6E, 0xC0, 0x44, 0x78, 0x85, 0x27, 0xA0, 0x9E, 0x17,
    0x5E, 0xCA, 0x35, 0x34, 0xF1, 0xE4, 0xE2, 0xA1, 0x16, 0x00,
    0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60,
    0x82,
};
wxBitmap& trash_png_to_wx_bitmap()
{
    static wxMemoryInputStream memIStream( trash_png, sizeof( trash_png ) );
    static wxImage image( memIStream, wxBITMAP_TYPE_PNG );
    static wxBitmap bmp( image );
    return bmp;
}
#endif //TRASH_PNG_H
ui/icons/16/cross_circle.png
ui/icons/16/cube.png
ui/icons/16/disk.png
ui/icons/16/file_import.png
ui/icons/16/forward.png
ui/icons/16/images.png
ui/icons/16/palette.png
ui/icons/16/pause.png
ui/icons/16/picture.png
ui/icons/16/play.png
ui/icons/16/refresh.png
ui/icons/16/replace.png
ui/icons/16/rewind.png
ui/icons/16/rotate_right.png
ui/icons/16/settings.png
ui/icons/16/text_box_dots.png
ui/icons/16/trash.png
ui/utils.hpp
New file
@@ -0,0 +1,383 @@
#ifndef __MAINFRAME_HPP__UTILS
#define __MAINFRAME_HPP__UTILS
#include <string>
#include <filesystem>
#include <iostream>
#include <opencv2/opencv.hpp>
#include <stable-diffusion.h>
#include <nlohmann/json.hpp>
namespace sd_gui_utils
{
    enum THREAD_STATUS_MESSAGES
    {
        MESSAGE,
        MODEL_LOAD_START,
        MODEL_LOAD_DONE,
        MODEL_LOAD_ERROR,
        GENERATION_START,
        GENERATION_PROGRESS,
        GENERATION_DONE,
        GENERATION_ERROR
    };
    struct cout_redirect
    {
        cout_redirect(std::streambuf *new_buffer)
            : old(std::cout.rdbuf(new_buffer))
        {
        }
        ~cout_redirect()
        {
            std::cout.rdbuf(old);
        }
    private:
        std::streambuf *old;
    };
    struct config
    {
        std::string model = "";
        std::string vae = "";
        std::string lora = "";
        std::string embedding = "";
        std::string presets = "";
        std::string output = "";
        std::string jobs = "";
        bool keep_model_in_memory = true;
        bool save_all_image = true;
    };
    enum DirTypes
    {
        LORA,
        CHECKPOINT,
        VAE,
        PRESETS,
        PROMPTS,
        NEG_PROMPTS
    };
    struct generator_preset
    {
        double cfg;
        int seed;
        int clip_skip;
        int steps;
        int width, height;
        sample_method_t sampler;
        std::string name;
        std::string mode; // modes_str
        int batch;
        std::string path;
    };
    inline void to_json(nlohmann::json &j, const generator_preset &p)
    {
        j = nlohmann::json{
            {"cfg", p.cfg},
            {"seed", p.seed},
            {"clip_skip", p.clip_skip},
            {"steps", p.steps},
            {"width", p.width},
            {"height", p.height},
            {"name", p.name},
            {"mode", p.mode},
            {"sampler", (int)p.sampler},
            {"batch", p.batch},
        };
    }
    inline void from_json(const nlohmann::json &j, generator_preset &p)
    {
        j.at("cfg").get_to(p.cfg);
        j.at("seed").get_to(p.seed);
        j.at("clip_skip").get_to(p.clip_skip);
        j.at("steps").get_to(p.steps);
        j.at("width").get_to(p.width);
        j.at("height").get_to(p.height);
        j.at("name").get_to(p.name);
        j.at("mode").get_to(p.mode);
        j.at("batch").get_to(p.batch);
        p.sampler = j.at("sampler").get<sample_method_t>();
    }
    inline int GetCurrentUnixTimestamp()
    {
        const auto p1 = std::chrono::system_clock::now();
        return static_cast<int>(std::chrono::duration_cast<std::chrono::seconds>(p1.time_since_epoch()).count());
    }
    inline bool replace(std::string &str, const std::string &from, const std::string &to)
    {
        size_t start_pos = str.find(from);
        if (start_pos == std::string::npos)
            return false;
        str.replace(start_pos, from.length(), to);
        return true;
    }
    inline std::string normalizePath(const std::string &messyPath)
    {
        std::filesystem::path path(messyPath);
        std::filesystem::path canonicalPath = std::filesystem::weakly_canonical(path);
        std::string npath = canonicalPath.make_preferred().string();
        char toReplace = '\\';
        char replacement = '/';
        std::replace(npath.begin(), npath.end(), toReplace, replacement);
        return npath;
    }
    // sd c++
    inline const char *sample_method_str[] = {
        "euler_a",
        "euler",
        "heun",
        "dpm2",
        "dpm++2s_a",
        "dpm++2m",
        "dpm++2mv2",
        "lcm",
    };
    inline const char *schedule_str[] = {
        "default",
        "discrete",
        "karras",
    };
    inline const char *modes_str[] = {
        "txt2img",
        "img2img",
        "convert",
    };
    enum SDMode
    {
        TXT2IMG,
        IMG2IMG,
        CONVERT,
        MODE_COUNT
    };
    struct SDParams
    {
        int n_threads = -1;
        SDMode mode = TXT2IMG;
        std::string model_path;
        std::string vae_path;
        std::string taesd_path;
        std::string esrgan_path;
        std::string controlnet_path;
        std::string embeddings_path;
        sd_type_t wtype = SD_TYPE_COUNT;
        std::string lora_model_dir;
        std::string output_path = "output.png";
        std::string input_path;
        std::string control_image_path;
        std::string prompt;
        std::string negative_prompt;
        float cfg_scale = 7.0f;
        int clip_skip = -1; // <= 0 represents unspecified
        int width = 512;
        int height = 512;
        int batch_count = 1;
        sample_method_t sample_method = EULER_A;
        schedule_t schedule = DEFAULT;
        int sample_steps = 20;
        float strength = 0.75f;
        float control_strength = 0.9f;
        rng_type_t rng_type = CUDA_RNG;
        int64_t seed = 42;
        bool verbose = false;
        bool vae_tiling = false;
        bool control_net_cpu = false;
        bool canny_preprocess = false;
        SDParams() = default;
        // copy constructor...
        SDParams(const SDParams &other)
            : n_threads(other.n_threads), mode(other.mode), model_path(other.model_path),
              vae_path(other.vae_path), taesd_path(other.taesd_path), esrgan_path(other.esrgan_path),
              controlnet_path(other.controlnet_path), embeddings_path(other.embeddings_path),
              wtype(other.wtype), lora_model_dir(other.lora_model_dir), output_path(other.output_path),
              input_path(other.input_path), control_image_path(other.control_image_path),
              prompt(other.prompt), negative_prompt(other.negative_prompt), cfg_scale(other.cfg_scale),
              clip_skip(other.clip_skip), width(other.width), height(other.height), batch_count(other.batch_count),
              sample_method(other.sample_method), schedule(other.schedule), sample_steps(other.sample_steps),
              strength(other.strength), control_strength(other.control_strength), rng_type(other.rng_type),
              seed(other.seed), verbose(other.verbose), vae_tiling(other.vae_tiling),
              control_net_cpu(other.control_net_cpu), canny_preprocess(other.canny_preprocess){
                                                          // Másolat létrehozása
                                                      };
        SDParams &operator=(const SDParams &other)
        {
            if (this != &other) // Ellenőrizzük, hogy ne másoljuk önmagát
            {
                n_threads = other.n_threads;
                mode = other.mode;
                model_path = other.model_path;
                vae_path = other.vae_path;
                taesd_path = other.taesd_path;
                esrgan_path = other.esrgan_path;
                controlnet_path = other.controlnet_path;
                embeddings_path = other.embeddings_path;
                wtype = other.wtype;
                lora_model_dir = other.lora_model_dir;
                output_path = other.output_path;
                input_path = other.input_path;
                control_image_path = other.control_image_path;
                prompt = other.prompt;
                negative_prompt = other.negative_prompt;
                cfg_scale = other.cfg_scale;
                clip_skip = other.clip_skip;
                width = other.width;
                height = other.height;
                batch_count = other.batch_count;
                sample_method = other.sample_method;
                schedule = other.schedule;
                sample_steps = other.sample_steps;
                strength = other.strength;
                control_strength = other.control_strength;
                rng_type = other.rng_type;
                seed = other.seed;
                verbose = other.verbose;
                vae_tiling = other.vae_tiling;
                control_net_cpu = other.control_net_cpu;
                canny_preprocess = other.canny_preprocess;
            }
            return *this;
        }
    };
    /* JSONize SD Params*/
    inline void to_json(nlohmann::json &j, const SDParams &p)
    {
        j = nlohmann::json{
            {"n_threads", p.n_threads},
            {"mode", (int)p.mode},
            {"model_path", p.model_path},
            {"vae_path", p.vae_path},
            {"taesd_path", p.taesd_path},
            {"esrgan_path", p.esrgan_path},
            {"controlnet_path", p.controlnet_path},
            {"embeddings_path", p.embeddings_path},
            {"wtype", (int)p.wtype},
            {"lora_model_dir", p.lora_model_dir},
            {"output_path", p.output_path},
            {"input_path", p.input_path},
            {"control_image_path", p.control_image_path},
            {"prompt", p.prompt},
            {"negative_prompt", p.negative_prompt},
            {"cfg_scale", p.cfg_scale},
            {"clip_skip", p.clip_skip},
            {"width", p.width},
            {"height", p.height},
            {"sample_method", (int)p.sample_method},
            {"schedule", (int)p.schedule},
            {"sample_steps", p.sample_steps},
            {"strength", p.strength},
            {"control_strength", p.control_strength},
            {"rng_type", (int)p.rng_type},
            {"seed", p.seed},
            {"verbose", p.verbose},
            {"vae_tiling", p.vae_tiling},
            {"control_net_cpu", p.control_net_cpu},
            {"canny_preprocess", p.canny_preprocess},
        };
    }
    inline void from_json(const nlohmann::json &j, SDParams &p)
    {
        j.at("n_threads").get_to(p.n_threads);
        p.mode = j.at("mode").get<sd_gui_utils::SDMode>();
        j.at("model_path").get_to(p.model_path);
        j.at("vae_path").get_to(p.vae_path);
        j.at("taesd_path").get_to(p.taesd_path);
        j.at("esrgan_path").get_to(p.esrgan_path);
        j.at("controlnet_path").get_to(p.controlnet_path);
        j.at("embeddings_path").get_to(p.embeddings_path);
        p.wtype = j.at("wtype").get<sd_type_t>();
        j.at("lora_model_dir").get_to(p.lora_model_dir);
        j.at("output_path").get_to(p.output_path);
        j.at("input_path").get_to(p.input_path);
        j.at("control_image_path").get_to(p.control_image_path);
        j.at("prompt").get_to(p.prompt);
        j.at("negative_prompt").get_to(p.negative_prompt);
        j.at("cfg_scale").get_to(p.cfg_scale);
        j.at("width").get_to(p.width);
        j.at("height").get_to(p.height);
        j.at("batch_count").get_to(p.batch_count);
        p.sample_method = j.at("sample_method").get<sample_method_t>();
        p.schedule = j.at("schedule").get<schedule_t>();
        j.at("sample_steps").get_to(p.sample_steps);
        j.at("strength").get_to(p.strength);
        j.at("control_strength").get_to(p.control_strength);
        p.rng_type = j.at("rng_type").get<rng_type_t>();
        j.at("seed").get_to(p.seed);
        j.at("verbose").get_to(p.verbose);
        j.at("vae_tiling").get_to(p.vae_tiling);
        j.at("control_net_cpu").get_to(p.control_net_cpu);
        j.at("canny_preprocess").get_to(p.canny_preprocess);
    }
    /* JSONize SD Params*/
    // sd c++
    /*cv::Mat GetSquareImage(const unsigned char *img_data, int width, int height, int target_width = 500)
     {
         unsigned char * img_data_ptr = (unsigned char*) &img_data;
         cv::Mat mat(height, width, CV_8UC1, img_data_ptr);
         return GetSquareImage(mat, target_width);
     }
     cv::Mat GetSquareImage(const char *data, int width, int height, int target_width = 500)
     {
         cv::Mat mat(height, width, CV_8UC1, &data[0]);
         return GetSquareImage(mat, target_width);
     }*/
    // opencv stuffs
    inline cv::Mat GetSquareImage(const cv::Mat &img, int target_width = 500)
    {
        int width = img.cols,
            height = img.rows;
        cv::Mat square = cv::Mat::zeros(target_width, target_width, img.type());
        int max_dim = (width >= height) ? width : height;
        float scale = ((float)target_width) / max_dim;
        cv::Rect roi;
        if (width >= height)
        {
            roi.width = target_width;
            roi.x = 0;
            roi.height = static_cast<float>(height) * scale;
            roi.y = (target_width - roi.height) / 2;
        }
        else
        {
            roi.y = 0;
            roi.height = target_width;
            roi.width = static_cast<float>(width) * scale;
            roi.x = (target_width - roi.width) / 2;
        }
        cv::resize(img, square(roi), roi.size());
        return square;
    }
};
#endif
ui/ver.hpp
New file
@@ -0,0 +1,5 @@
#ifndef __MAINFRAME_HPP__VERSIONS
#define __MAINFRAME_HPP__VERSIONS
#define SD_GUI_VERSION "0.1.1-beta"
#define SD_CPP_VERSION "c6071fa"
#endif
ui/windows.fbp
New file
Diff too large
vcpkg-configuration.json
New file
@@ -0,0 +1,14 @@
{
  "default-registry": {
    "kind": "git",
    "baseline": "7233110263ec34c316fd12d0a91c11d1ca9f860b",
    "repository": "https://github.com/microsoft/vcpkg"
  },
  "registries": [
    {
      "kind": "artifact",
      "location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip",
      "name": "microsoft"
    }
  ]
}
vcpkg.json
New file
@@ -0,0 +1,9 @@
{
  "dependencies": [
    "fmt",
    "wxwidgets",
    "cuda",
    "nlohmann-json",
    "opencv4"
  ]
}