| 59 | } |
| 60 | |
| 61 | bool 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 | |
| 80 | sd_image_t *readControlImage(Span<uint8_t> ControlImage, int Width, int Height, |
| 81 | bool CannyPreprocess) { |
no test coverage detected