Some SD finetunes (and the official Stable Diffusion 2) use v-prediction because they observe that it's better
Currently, v-prediction models will export with Olive and run fine with the ONNX diffusers pipeline, but not here. This is "a castle" on one I exported
auto predictedOriginalSample = output.BinaryOperation<float>(input, [currentSigma](float a, float b) {
float sigmaSquared = currentSigma * currentSigma;
return (a * (-currentSigma / sqrt(sigmaSquared + 1))) + (b / sqrt(sigmaSquared + 1));
});
auto predictedOriginalSample = output.BinaryOperation<float>(input, [currentSigma](float model_output, float sample){
float sigmaSquaredPlusOne = currentSigma * currentSigma + 1;
return (model_output * (-currentSigma / std::sqrt(sigmaSquaredPlusOne))) + (sample / sigmaSquaredPlusOne);
});