#ifndef __SD_PIPELINE_MODEL_BUILDERS_H__ #define __SD_PIPELINE_MODEL_BUILDERS_H__ #include #include #include "model.h" #include "stable-diffusion.h" class SDBackendManager; struct DeviceResidencyManager; struct Conditioner; struct FrozenCLIPVisionEmbedder; struct DiffusionModelRunner; struct VAE; struct AudioVAERunner; struct ControlNet; namespace Wav2Vec2 { class Wav2Vec2ModelRunner; } struct GenerationExtension; struct GenerationExtensionInitContext; namespace IPAdapter { struct IPAdapterRunner; } namespace sd::model_builders { struct Context { const sd_ctx_params_t& params; SDVersion version; const String2TensorStorage& tensor_storage_map; SDBackendManager& backends; std::shared_ptr weight_manager; }; struct CoreRunners { std::shared_ptr conditioner; std::shared_ptr diffusion; std::shared_ptr high_noise_diffusion; std::shared_ptr clip_vision; std::shared_ptr ip_adapter; std::shared_ptr audio_encoder; }; struct VAEOptions { bool use_tae = false; bool tae_preview_only = false; bool use_audio_vae = false; bool external_vae_is_invalid = false; }; struct VAERunners { std::shared_ptr vae; std::shared_ptr preview; std::shared_ptr audio; }; bool build_core_runners(const Context& ctx, CoreRunners& runners); bool build_vae_runners(const Context& ctx, const VAEOptions& options, VAERunners& runners); bool build_control_net_runner(const Context& ctx, std::shared_ptr& runner); bool build_extension_runners(const GenerationExtensionInitContext& ctx, std::vector>& extensions); } // namespace sd::model_builders #endif // __SD_PIPELINE_MODEL_BUILDERS_H__