axodox / axodox-machinelearning

This repository contains a pure C++ ONNX implementation of multiple offline AI models, such as StableDiffusion (1.5 and XL), ControlNet, Midas, HED and OpenPose.
MIT License
604 stars 34 forks source link

Support using FP32 SD checkpoints #4

Closed lmagder closed 7 months ago

lmagder commented 1 year ago

Check the input type the session needs before unconditionally converting to fp16. Make ToSingle and ToHalf methods no-ops if the Tensor is already in the right format

axodox commented 1 year ago

Can you please provide me some example model for testing?

lmagder commented 1 year ago

Sure, no problem. The model I was using was trained on images of people I know IRL so I don't want to post it publicly, but I can convert the base SD2.1 checkpoint to the same format which should also reproduce it. I'll can link that once I do it, but basically I'm using the Automatic1111 Dreamboth extension and it defaults to saving FP32 checkpoints for it's output.

lmagder commented 1 year ago

Ok here's a FP32 conversion of the SD 1.5 model: FP32-SDv1-5_512_onnx I found 2.1 models don't work with this lib yet. Not sure if it assumes the 1.5 config?

I removed the unpaint tag since it's basically just a larger version of the one you uploaded so I didn't want to confuse people, but another bug I found is that if you download it via Unpaint doesn't download the unet/weights.pb file, however it works if you manually copy it to the folder

axodox commented 7 months ago

I have added support for this with SDXL which is now merged