ACMX 2.139.0
Dual-Backend Real-Time GPU Video Synthesis
Loading...
Searching...
No Matches
options.hpp
Go to the documentation of this file.
1#ifndef ACMXVK_APP_OPTIONS_HPP
2#define ACMXVK_APP_OPTIONS_HPP
3
4#include <array>
5#include <cstdint>
6#include <filesystem>
7#include <iosfwd>
8#include <string>
9#include <string_view>
10#include <vector>
11
12namespace acmxvk {
13 namespace fs = std::filesystem;
14
15 constexpr std::array<std::string_view, 35> CROSSFADE_NAMES{"xfade_01_linear", "xfade_02_block", "xfade_03_wipe", "xfade_04_radial", "xfade_05_pixelate", "xfade_06_dissolve", "xfade_07_swirl", "xfade_08_glitch", "xfade_09_diamond", "xfade_10_burn", "xfade_11_fade_black", "xfade_12_fade_white", "xfade_13_slide_left", "xfade_14_slide_right", "xfade_15_slide_up", "xfade_16_slide_down", "xfade_17_diagonal_wipe", "xfade_18_iris_open", "xfade_19_iris_close", "xfade_20_checker", "xfade_21_blinds_h", "xfade_22_blinds_v", "xfade_23_zoom_in", "xfade_24_zoom_out", "xfade_25_rotate", "xfade_26_ripple", "xfade_27_wave", "xfade_28_chroma", "xfade_29_invert", "xfade_30_flash", "xfade_31_explode", "xfade_32_mosaic", "xfade_33_shutter", "xfade_34_luma", "xfade_35_noise"};
16
18
20 std::string file;
21 double multiplier = 1.0;
22 };
23
24 struct Options {
25 int width = 1280;
26 int height = 720;
27 int camera_width = 1280;
28 int camera_height = 720;
31 int shader_index = 0;
32 int encode_crf = 18;
33 std::int64_t encode_bitrate = 0;
37 int png_level = 6;
38 int cache_delay = 1;
45 int midi_device = -1;
47 int cuda_device = 0;
49 int dream_size = 512;
50 int dream_channel = -1;
52 int dream_jitter = 0;
61 double requested_fps = 0.0;
62 double duration = 0.0;
63 double cross_fade_duration = 0.5;
64 double time_speed = 1.0;
65 double max_size_mb = 0.0;
66 double audio_sensitivity = 1.0;
67 double audio_warm_rate = 0.5;
70 double human_black_point = 0.35;
71 double human_white_point = 0.75;
72 double dream_strength = 0.05;
73 double dream_feedback = 0.9;
74 double dream_zoom = 1.01;
75 double dream_rotation = 0.1;
76 double dream_octave_scale = 1.4;
81 bool use_yuv = false;
82 bool maximize_fps = false;
83 bool use_source_fps = false;
84 bool use_source_audio = false;
85 bool fullscreen = false;
86 bool headless = false;
87 bool repeat = false;
88 bool enable_vsync = false;
89 bool enable_screenshot = false;
90 bool enable_playlist = false;
93 bool history_test = false;
94 bool enable_3d = false;
95 bool normalized_time = false;
96 bool flip_output = false;
97 bool png_output = false;
98 bool encode_realtime = false;
99 bool no_drop = false;
101 bool fill_pts_gaps = false;
102 bool copy_audio = false;
103 bool mute_output = false;
104 bool enable_audio = false;
105 bool enable_audio_time = false;
111 bool audio_pass_through = false;
112 bool audio_repeat = false;
113 bool audio_trunc = false;
114 bool list_audio_devices = false;
116 bool check_audio = false;
118 bool midi_monitor = false;
119 bool list_midi_devices = false;
120 bool check_midi = false;
123 bool list_gpu_filters = false;
124 bool list_cuda_devices = false;
125 bool check_cuda = false;
126 bool check_dnn = false;
127 bool check_deep_dream = false;
135 bool dream_fp16 = false;
142 bool dream_headless = false;
143 bool deep_original = false;
150 bool human_background = false;
153 bool list_encoders = false;
154 bool display_filter = false;
155 bool disable_counter = false;
156 bool build_fix = false;
157 bool build_prune = false;
158 bool build_force = false;
160 bool unbuffered_output = false;
161 bool interface_shm = false;
162 bool show_help = false;
164 std::vector<int> shader_pass_indices;
165 std::vector<std::string> shader_pass_files;
166 std::vector<std::string> custom_uniform_overrides;
167 std::vector<std::string> midi_cc_mappings;
168 std::vector<int> gpu_filter_indices;
169 std::vector<StableDiffusionLora> stable_diffusion_loras;
170 std::vector<std::string> stable_diffusion_server_arguments;
171 std::string input_file;
172 std::string graphic_file;
173 std::string shader_directory;
174 std::string fragment_shader;
175 std::string compute_shader;
176 std::string shader_file;
177 std::string build_manifest;
178 std::string build_directory;
179 std::string glslc_executable = "glslc";
180 std::string model_file;
181 std::string playlist_file;
182 std::string output_file;
184 std::string encode_preset = "medium";
185 std::string encode_tune;
186 std::string encode_codec = "auto";
187 std::string encode_params;
189 std::string probe_hdr_file;
190 std::string audio_file;
191 std::string record_audio_file;
192 std::string midi_map_file;
193 std::string edge_model;
194 std::string human_model;
196 std::string dream_model;
197 std::string dream_layer;
202 std::string stable_diffusion_server = "sd-server";
203 std::string stable_diffusion_sampler = "euler_a";
204 std::string stable_diffusion_scheduler = "discrete";
205 std::string snapshot_directory = ".";
207 std::string watermark_text;
208 std::array<std::uint8_t, 3> watermark_color{255U, 0U, 150U};
209 };
210
211 [[nodiscard]] bool dimensions_supported(int width, int height);
212 [[nodiscard]] int parseInteger(std::string_view text, std::string_view option);
213 [[nodiscard]] double parseNumber(std::string_view text, std::string_view option);
214 [[nodiscard]] Options parseOptions(int argc, char **argv);
215 void printHelp(std::ostream &output);
216 void printEncoders(std::ostream &output);
217 [[nodiscard]] bool printEncoderOptions(std::string_view encoder_name, std::ostream &output, std::ostream &error);
218 [[nodiscard]] std::string trim(std::string text);
219
220} // namespace acmxvk
221
222#endif
void printEncoders(std::ostream &output)
Definition options.cpp:1432
void printHelp(std::ostream &output)
Definition options.cpp:1194
std::string trim(std::string text)
Definition options.cpp:1454
int parseInteger(std::string_view text, std::string_view option)
Definition options.cpp:124
bool dimensions_supported(int width, int height)
Definition options.cpp:50
bool printEncoderOptions(std::string_view encoder_name, std::ostream &output, std::ostream &error_output)
Definition options.cpp:1439
FrameRotation
Definition options.hpp:17
Options parseOptions(int argc, char **argv)
Definition options.cpp:282
double parseNumber(std::string_view text, std::string_view option)
Definition options.cpp:139
constexpr std::array< std::string_view, 35 > CROSSFADE_NAMES
Definition options.hpp:15
bool enable_audio_time
Definition options.hpp:105
int stable_diffusion_upscale_working_width
Definition options.hpp:56
std::string encode_params
Definition options.hpp:187
bool gpu_buffer_specified
Definition options.hpp:121
int audio_output_device
Definition options.hpp:43
std::string edge_model
Definition options.hpp:193
std::string snapshot_directory
Definition options.hpp:205
std::string shader_file
Definition options.hpp:176
double max_size_mb
Definition options.hpp:65
bool encode_realtime
Definition options.hpp:98
std::string png_output_directory
Definition options.hpp:183
bool dream_zoom_specified
Definition options.hpp:132
bool stable_diffusion_after_shaders
Definition options.hpp:146
std::int64_t encode_bitrate
Definition options.hpp:33
bool unbuffered_output
Definition options.hpp:160
bool midi_device_specified
Definition options.hpp:117
bool stable_diffusion_quiet
Definition options.hpp:149
std::string glslc_executable
Definition options.hpp:179
double audio_recording_gain
Definition options.hpp:69
std::vector< int > shader_pass_indices
Definition options.hpp:164
bool dream_octave_scale_specified
Definition options.hpp:138
std::string stable_diffusion_model
Definition options.hpp:198
double dream_octave_scale
Definition options.hpp:76
std::string encode_codec
Definition options.hpp:186
std::string dream_layer
Definition options.hpp:197
std::string stable_diffusion_server
Definition options.hpp:202
bool cuda_device_specified
Definition options.hpp:122
bool use_source_audio
Definition options.hpp:84
double time_speed
Definition options.hpp:64
double random_dream_interval
Definition options.hpp:77
std::string build_manifest
Definition options.hpp:177
std::string stable_diffusion_scheduler
Definition options.hpp:204
bool gpu_filter_before_dream
Definition options.hpp:144
std::string dream_model
Definition options.hpp:196
bool dream_rotation_specified
Definition options.hpp:133
int stable_diffusion_server_port
Definition options.hpp:60
double audio_pass_through_gain
Definition options.hpp:68
std::string build_directory
Definition options.hpp:178
std::vector< std::string > stable_diffusion_server_arguments
Definition options.hpp:170
double dream_rotation
Definition options.hpp:75
std::vector< std::string > custom_uniform_overrides
Definition options.hpp:166
std::vector< StableDiffusionLora > stable_diffusion_loras
Definition options.hpp:169
bool dream_feedback_specified
Definition options.hpp:131
std::string fragment_shader
Definition options.hpp:174
std::vector< std::string > shader_pass_files
Definition options.hpp:165
double duration
Definition options.hpp:62
bool random_dream_specified
Definition options.hpp:141
std::string audio_file
Definition options.hpp:190
bool audio_recording_gain_specified
Definition options.hpp:110
bool audio_input_specified
Definition options.hpp:106
std::string resource_directory
Definition options.hpp:206
bool human_background
Definition options.hpp:150
FrameRotation frame_rotation
Definition options.hpp:163
std::string output_file
Definition options.hpp:182
int texture_cache_size
Definition options.hpp:40
bool list_camera_devices
Definition options.hpp:115
std::string midi_map_file
Definition options.hpp:192
std::string model_file
Definition options.hpp:180
bool check_stable_diffusion
Definition options.hpp:128
bool enable_playlist
Definition options.hpp:90
double stable_diffusion_strength
Definition options.hpp:78
int stable_diffusion_height
Definition options.hpp:55
std::vector< int > gpu_filter_indices
Definition options.hpp:168
std::string watermark_text
Definition options.hpp:207
int stable_diffusion_width
Definition options.hpp:54
double dream_feedback
Definition options.hpp:73
std::vector< std::string > midi_cc_mappings
Definition options.hpp:167
std::string stable_diffusion_upscale_model
Definition options.hpp:199
std::string graphic_file
Definition options.hpp:172
double dream_strength
Definition options.hpp:72
int audio_input_device
Definition options.hpp:42
bool stable_diffusion_upscale
Definition options.hpp:147
bool audio_warm_rate_specified
Definition options.hpp:107
double audio_warm_rate
Definition options.hpp:67
int stable_diffusion_upscale_working_height
Definition options.hpp:57
double stable_diffusion_cfg_scale
Definition options.hpp:79
bool list_cuda_devices
Definition options.hpp:124
std::string shader_directory
Definition options.hpp:173
std::string onnx_configuration
Definition options.hpp:195
std::string encode_tune
Definition options.hpp:185
std::string record_audio_file
Definition options.hpp:191
std::string stable_diffusion_sampler
Definition options.hpp:203
std::string human_model
Definition options.hpp:194
std::string stable_diffusion_negative_prompt
Definition options.hpp:201
int gpu_frame_buffer_size
Definition options.hpp:46
int stable_diffusion_steps
Definition options.hpp:58
bool list_audio_devices
Definition options.hpp:114
std::string playlist_file
Definition options.hpp:181
bool dream_channel_specified
Definition options.hpp:136
double dream_zoom
Definition options.hpp:74
bool dream_smoothing_specified
Definition options.hpp:140
double requested_fps
Definition options.hpp:61
bool dream_jitter_specified
Definition options.hpp:139
int enumerate_camera_device
Definition options.hpp:30
bool stable_diffusion_upscale_only
Definition options.hpp:148
bool constant_frame_rate
Definition options.hpp:100
bool normalized_time
Definition options.hpp:95
std::array< std::uint8_t, 3 > watermark_color
Definition options.hpp:208
bool enable_texture_cache
Definition options.hpp:92
bool check_deep_dream
Definition options.hpp:127
std::string list_encoder_options
Definition options.hpp:188
std::string encode_preset
Definition options.hpp:184
bool audio_output_specified
Definition options.hpp:108
std::string input_file
Definition options.hpp:171
bool dream_size_specified
Definition options.hpp:134
bool list_midi_devices
Definition options.hpp:119
double cross_fade_duration
Definition options.hpp:63
bool dream_octaves_specified
Definition options.hpp:137
int stable_diffusion_seed
Definition options.hpp:59
bool dream_iterations_specified
Definition options.hpp:129
bool resolution_specified
Definition options.hpp:80
bool audio_pass_through
Definition options.hpp:111
bool enable_screenshot
Definition options.hpp:89
bool build_parallel_specified
Definition options.hpp:159
std::string probe_hdr_file
Definition options.hpp:189
bool enable_random_autopilot
Definition options.hpp:91
double human_black_point
Definition options.hpp:70
bool audio_pass_through_gain_specified
Definition options.hpp:109
double human_white_point
Definition options.hpp:71
bool use_source_fps
Definition options.hpp:83
int autopilot_random_timeout
Definition options.hpp:35
bool human_white_specified
Definition options.hpp:152
int generate_interval
Definition options.hpp:36
bool list_gpu_filters
Definition options.hpp:123
bool human_black_specified
Definition options.hpp:151
std::string compute_shader
Definition options.hpp:175
std::string stable_diffusion_prompt
Definition options.hpp:200
bool stable_diffusion_option_specified
Definition options.hpp:145
double audio_sensitivity
Definition options.hpp:66
bool dream_strength_specified
Definition options.hpp:130