openvinotoolkit / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
250 stars 39 forks source link

Add support for negative prompt weighting #47

Closed sjrummins closed 9 months ago

sjrummins commented 10 months ago

Description

Thank you both so much for the very rapid response to issue https://github.com/openvinotoolkit/stable-diffusion-webui/issues/43 with pull request https://github.com/openvinotoolkit/stable-diffusion-webui/pull/46!

I think it would be good to support prompt weights on the negative prompt as well. I believe this is supported when not using OpenVINO acceleration.

I think I have been able to implement this myself following the example of https://github.com/openvinotoolkit/stable-diffusion-webui/pull/46.

Screenshots/videos:

I've experimented with prompt:

Evening street scene, New York, 1930

and negative prompt:

lamp, (people:1.5)

If I run this without OpenVINO acceleration, I get: 00018-879204008-fixedprompt-cpu-2m50

If I run this with OpenVINO acceleration without this code change, I get: 00020-879204008-fixedprompt-openvino-1m49 Note that the two are different.

With OpenVINO acceleration with this code change, I get: 00019-879204008-fixedprompt-openvinopatched-1m18 This more-or-less matches the non-accelerated version, which suggests to me that the change is working correctly.

Checklist:

(I have tried to run the tests but they fail with an error "No module named 'gradio'". This happens with or without my code change.)

sjrummins commented 10 months ago

I installed gradio and the tests now pass.

devangaggarwal commented 10 months ago

Great work, @sjrummins ! LGTM, @ynimmaga can you review as well.