MNN
MNN copied to clipboard
How to get SD mnn model used in transformers/diffussion/diffussion_demo
Used at here:
// load text_encoder model
{
std::string model_path = modelPath + "/text_encoder.mnn";
mModules[0].reset(Module::load(
{"input_ids"}, {"last_hidden_state", "pooler_output"}, model_path.c_str(), runtime_manager_, &module_config));
}
// load unet model
{
std::string model_path = modelPath + "/unet.mnn";
mModules[1].reset(Module::load(
{"sample", "timestep", "encoder_hidden_states"}, {"out_sample"}, model_path.c_str(), runtime_manager_, &module_config));
}
// load vae_decoder model
{
std::string model_path = modelPath + "/vae_decoder.mnn";
mModules[2].reset(Module::load(
{"latent_sample"}, {"sample"}, model_path.c_str(), runtime_manager_, &module_config));
}