MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / parameterCheck

Function parameterCheck

plugins/wasmedge_stablediffusion/sd_func.cpp:61–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59 }
60
61bool parameterCheck(SDEnviornment &Env, uint32_t Width, uint32_t Height,
62 uint32_t SessionId) {
63 if (SessionId >= Env.getContextSize()) {
64 spdlog::error("[WasmEdge-StableDiffusion] Session ID is invalid."sv);
65 return false;
66 }
67 if (Width % 64 != 0) {
68 spdlog::error(
69 "[WasmEdge-StableDiffusion] Width must be a multiple of 64 and greater than 0."sv);
70 return false;
71 }
72 if (Height % 64 != 0) {
73 spdlog::error(
74 "[WasmEdge-StableDiffusion] Height must be a multiple of 64 and greater than 0."sv);
75 return false;
76 }
77 return true;
78}
79
80sd_image_t *readControlImage(Span<uint8_t> ControlImage, int Width, int Height,
81 bool CannyPreprocess) {

Callers 1

bodyMethod · 0.85

Calls 2

getContextSizeMethod · 0.80
errorFunction · 0.50

Tested by

no test coverage detected