!_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)
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.
!_onnxEnvironment
expression should be evaluated before usage of_onnxEnvironment->DeviceId
in the codevoid StableDiffusionModelExecutor::EnsureEnvironment(std::string_view modelId) { if (_modelId != modelId || _onnxEnvironment->DeviceId != int32_t(_unpaintOptions->AdapterIndex()) || !_onnxEnvironment)