mlc-ai / web-stable-diffusion

Bringing stable diffusion models to web browsers. Everything runs inside the browser with no server support.
https://mlc.ai/web-stable-diffusion
Apache License 2.0
3.56k stars 227 forks source link

Quality of the image is poor. #60

Closed sunzj closed 6 months ago

sunzj commented 7 months ago

I try sd1.5 and SDXL, the result seems dont as i expected.

i tried the following prompt on sdxl, https://anakin.ai/blog/sdxl-photorealistic-prompts/

expected result are: image

image

but the result are blur and low quality.

I am not sure it's my config problem or it's a common issue.

happyme531 commented 6 months ago

I think on SDXL the issue is it is using vae config of sd1.5

https://github.com/happyme531/RK3588-stable-diffusion-GPU/blob/37957e25e3af6d959165829a1483e3c5416fcfc8/web_stable_diffusion/trace/model_trace.py#L93

And on SD1.5 the issue is the vae scale is wrong (see the commit in the above link)

sunzj commented 6 months ago

@happyme531

As i verified, the vae scale should always 1 / 0.18215.

I think on SDXL the issue is it is using vae config of sd1.5

https://github.com/happyme531/RK3588-stable-diffusion-GPU/blob/37957e25e3af6d959165829a1483e3c5416fcfc8/web_stable_diffusion/trace/model_trace.py#L93

And on SD1.5 the issue is the vae scale is wrong (see the commit in the above link)

sunzj commented 6 months ago

After test, some image quality issue should cause by the model,both 1.5 and xl have these issues. Such as, eyes, nose abnormal for full-body image, and portrait is normal.