MNN icon indicating copy to clipboard operation
MNN copied to clipboard

How to get SD mnn model used in transformers/diffussion/diffussion_demo

Open chenxijun1029 opened this issue 1 month ago • 1 comments

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));
    }

chenxijun1029 avatar Jun 05 '24 06:06 chenxijun1029