rupeshs / fastsdcpu

Fast stable diffusion on CPU
MIT License
1.43k stars 115 forks source link

[Feature] Add custom models for OpenVINO #61

Closed Disty0 closed 10 months ago

Disty0 commented 10 months ago

We can bake in the Lora, change the scheduler and convert it to OpenVINO for custom models. But these models need a few changes in the pipeline:

Example OpenVINO space and custom model:

image

image

rupeshs commented 10 months ago

@Disty0 Nice, I just added it in the branch https://github.com/rupeshs/fastsdcpu/tree/add-custom-models-support-for-openvino , negative prompt also working. However, the old model deinferno/LCM_Dreamshaper_v7-openvino is not working. How did you convert SoteMix to openvino?

Disty0 commented 10 months ago

Wrote this script for LCM conversion: https://github.com/vladmandic/automatic/blob/master/cli/lcm-convert.py

python lcm-convert.py --model Disty0/SoteMix --huggingface --name LCM_SoteMix --upload

or

python lcm-convert.py --model sotemix.safetensors --name LCM_SoteMix --upload

Add --no-half for FP32 weights.

Did OpenVINO conversion with optimum-cli:

optimum-cli export openvino --model Disty0/LCM_SoteMix LCM_SoteMix_OpenVINO

Then uploaded openvino files manually.

rupeshs commented 10 months ago

@Disty0 thanks so it is LCM-LoRA,right? not directly distilled model like SimianLuo/LCM_Dreamshaper_v7

Disty0 commented 10 months ago

@Disty0 thanks so it is LCM-LoRA,right? not directly distilled model like SimianLuo/LCM_Dreamshaper_v7

It's LCM LoRa baked in + replaced the scheduler with LCM.

Also my model has both PyTorch and OpenVINO weights in the same repo.

rupeshs commented 10 months ago

@Disty0 cool so we can use any SD1.5 or sdxl models.

rupeshs commented 10 months ago

@Disty0 Just created simple tools for the conversion, thanks for your script https://github.com/rupeshs/lcm-openvino-converter

rupeshs commented 10 months ago

Released https://github.com/rupeshs/fastsdcpu/tree/v1.0.0-beta.13