#pragma once #include "engine/framework/assets/tensor_source.h" #include "engine/framework/core/execution_context.h" #include #include #include namespace engine::models::auk { struct FlowEmbeddings { std::vector time; std::vector text; std::vector audio; std::vector first_block_audio; std::vector first_block_text; std::vector double_stream_audio; std::vector double_stream_text; std::vector single_stream; std::vector velocity; std::vector guided_velocity; std::map> first_block_boundaries; }; class FlowRuntime { public: FlowRuntime(core::ExecutionContext & execution, const assets::TensorSource & source, int64_t audio_frames, int64_t text_tokens, bool cfg = false, bool flash_attention = true, bool capture_intermediates = false, int64_t reference_frames = 0, int64_t valid_reference_frames = 0, int schedule_steps = 32); ~FlowRuntime(); FlowRuntime(const FlowRuntime &) = delete; FlowRuntime & operator=(const FlowRuntime &) = delete; void prepare(int64_t audio_frames, int64_t text_tokens); void prepare(int64_t audio_frames, int64_t text_tokens, bool cfg, int64_t reference_frames = 0, int64_t valid_reference_frames = 0, int schedule_steps = 32); FlowEmbeddings embed(const std::vector & audio, const std::vector & text, float time, float cfg_strength = 2.0F, const std::vector & reference = {}); std::vector sample(const std::vector & initial_noise, const std::vector & text, int steps = 32, float sway = -1.0F, float cfg_strength = 2.0F, const std::vector & reference = {}, bool distilled_flash = false); private: struct State; std::unique_ptr state_; }; } // namespace engine::models::auk