Found this with Google Agent. Is it safe?
`
sd_set_progress_callback(ProgressCallback, &m_stopRender);
sd_image_t* result = nullptr;
try
{
result = generate_image(ctx, &sd_img_gen_params);
_ASSERT(result && result[0].data);
}
catch (const std::runtime_error& e)
{
goto FreeMemory;
}
`
Progress CB look like this:
void ProgressCallback(int step, int steps, float time, void* user_data) { if (*((bool*)user_data)) { throw std::runtime_error("Generation interrupted."); } }
FreeMemory free the context(sd_ctx_t* )and output image memory.
THANKS!
Found this with Google Agent. Is it safe?
`
`
Progress CB look like this:
void ProgressCallback(int step, int steps, float time, void* user_data) { if (*((bool*)user_data)) { throw std::runtime_error("Generation interrupted."); } }FreeMemory free the context(sd_ctx_t* )and output image memory.
THANKS!