sddebz / stable-diffusion-krita-plugin

GNU Affero General Public License v3.0
423 stars 34 forks source link

add dialog to enter optional prompt in krita for txt2img and img2img #1

Closed SirFinley closed 2 years ago

SirFinley commented 2 years ago

This adds dialogs for txt2img and img2img in krita to let you enter a prompt. If left blank it will use the prompt from the krita_config.yaml file. It also adds krita/input,output folders to .gitignore

sddebz commented 2 years ago

Hi. Thank you for request. The prompt dialog is cool.

However I see two small problems with it right now:

  1. It breaks workflow where you repeatedly press hotkey to generate new outputs. Instead of just pressing hotkeys you will need to press Enter to skip dialog. I see two solutions here: add feature flag in krita_config.yaml so user can decide on using it or not OR add additional hotkey for dialog, where you can define your own options and run SD. I'll probably add such a dialog anyway this weekend.
  2. It removes some code that creates filter mask in Krita. Well maybe this functionality just suck, but I would prefer to hide it behind feature flag too. Without it you'll need to manually create mask layer if your selection is not rectangular. Also selection can be feathered to automatically create smooth transition between old picture and new SD output. The QTimer there is just a workaround to get over some Krita plugin api bug.
1blackbar commented 2 years ago

HEy can you enable issues panel so we can give you some feedback? I wanted ot say this works pretty great so far. I have some small issues with lasso working just once, you have to create new lassso path everytime even tho its already created from previous ctr+alt+ W so when you do img2img once with mask made by lassso, and you want to synthesize again immediately then it just ignores lasso mask, can you look into it ? it works fast when mask is active but when you do img2img again then its slowly synthesizing whole image which means lasso mask is ignored . This also causes issue with the damn feathering in krita, once you enable feather for lasso then plugin ignores the mask and goes synthesizing big area

Can you create inpainting mode? this guy did a demo on that - https://www.youtube.com/watch?v=N913hReVxMM

heres the model - https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/20

sddebz commented 2 years ago

I've enabled issues panel.

Lasso thing seems to be a bug, I've never actually tried lasso, will look into it.

Inpainting is actually very nice. I wanted to add it too, but didn't find the right model. Thank you for the link. However adding it will probably take some time. Webui doesn't have it yet I think and there is a problem with fitting both models on GPU. So we will probably need some switch here.

1blackbar commented 2 years ago

Theres also other inpainting called LAMA ,im using it often maybe it might be ableto be incluided in krita plugin somehow and used with shortcut ? Works pretty fast with gradio gui as well heres the repo im using https://github.com/Sanster/lama-cleaner Its not the same as SD but it works and has 3 models so far. Also does this repo of SD run in half precision mode? i get some speedup with half precision with practifcaly no loss in quailty

By they way that popup to enter prompt, it would be nice if it could store last prompt so you wont start empty, typin all that in will get tiring pretty fast, also ability to disable it woud be convenient.

sddebz commented 2 years ago

I'll close this request because it's possible to enter prompt in Krita window now without using yaml.