axinc-ai / ailia-models

The collection of pre-trained, state-of-the-art AI models for ailia SDK
2.04k stars 325 forks source link

Export stable diffusion as one model #1209

Closed kyakuno closed 1 year ago

kyakuno commented 1 year ago

3モデルに分割されていたStableDiffusionのdiffusionを1モデルでエクスポートするPRです。

1187

kyakuno commented 1 year ago

M2 Macでの速度 512x512 5steps

構成 BLAS MPS
従来(3モデル構成) 78106ms 40097ms
PR(1モデル構成) 71750ms 28473ms
kyakuno commented 1 year ago

実行方法

python3 stable-diffusion-txt2img.py --steps 5 --sampler DDIM --benchmark --legacy
python3 stable-diffusion-txt2img.py --steps 5 --sampler DDIM --benchmark
kyakuno commented 1 year ago

BasilMixの1モデルの出力

output

python3 stable-diffusion-txt2img.py --sd basil_mix --vae vae-ft-mse --sampler "DPM++ 2M Kerras" -i "masterpiece, best quality, ultra detailed, sketch, oil painting, 1 girl has silver long hair, eyelashes, jewelry eyes, twinklee eyes, glowing eyes, smile, office lady, tight skirt, looking at viewer, outdoor, street, night" --n_prompt "worst quality, low quality, bad anatomy, bad hands, missing arms, text error, missing fingers, jpeg artifacts, long neck, signature, watermark, blurry, fisheye lens, animal, deformed mutated disfigured, mutated hands, missing hands, extra hands, liquid hands, poorly drawn hands, mutated fingers, bad fingers, extra fingers, liquid fingers, poorly drawn fingers, bad legs, missing legs, extra legs, bad arms, extra arms, long torso, thick thighs, partial head, bad face, partial face, bad eyebrows" --steps 20
kyakuno commented 1 year ago

--onnx_clipでCLIPも一緒に動かすとメモリ不足か出力異常になるのでCLIPはCPUで動かす。