axodox / unpaint

A simple Windows / Xbox app for generating AI images with Stable Diffusion.
Other
273 stars 12 forks source link

Wrong check of onnx environment #34

Closed alex-aparin closed 1 year ago

alex-aparin commented 1 year ago

!_onnxEnvironment expression should be evaluated before usage of _onnxEnvironment->DeviceId in the code void StableDiffusionModelExecutor::EnsureEnvironment(std::string_view modelId) { if (_modelId != modelId || _onnxEnvironment->DeviceId != int32_t(_unpaintOptions->AdapterIndex()) || !_onnxEnvironment)

axodox commented 1 year ago

Yes, I guess I have not realized it since when _onnxEnvironment is nullptr, modelId were also not equal, so the mistake was not realized as an error. I pushed a fix.