diff --git a/examples/multimodal/stable_diffusion/cpp/main.cc b/examples/multimodal/stable_diffusion/cpp/main.cc index e0f487545..79051279f 100644 --- a/examples/multimodal/stable_diffusion/cpp/main.cc +++ b/examples/multimodal/stable_diffusion/cpp/main.cc @@ -205,6 +205,14 @@ int main() { auto mask_image = cv::imread("overture-creations-mask.png"); // 8. Predict + /* + * One may need to pass the initial noise to predict api. + * There's an example: + * std::vector latents_data = {xxxx}; + * fastdeploy::FDTensor latents; + * latents.SetExternalData({batch_size * num_images_per_prompt, latents_channels, height / 8, width / 8},fastdeploy::FDDataType::FP32, latents_data.data()); + * pipe.Predict(..., /* latents = *\/ &latents, ....); + */ std::vector prompts = { "Face of a yellow cat, high resolution, sitting on a park bench"}; std::vector outputs;