JasonS09 / comfy_sd_krita_plugin

Make AI art between canvas and nodes with Krita.
MIT License
148 stars 7 forks source link

Feature: add prompt load from layer #17

Closed ElliottLester closed 1 year ago

ElliottLester commented 1 year ago

Scope: We want to restore the state of SDImgPageBase from an already generated layer.

Requests for comment:

JasonS09 commented 1 year ago
  • Is this a reasonable design
  • Is it worth making an "info" class for holding generation information but no the base64 encoded images. -- this allows to/from json -- central list of properties

I think we can go with the class approach. May be a simpler and less confusing design than having to use the PROMPT_LOADER_KEYS list.

  • Should we update the model I don't because the user can't see it from the prompt screen. (expand info bar maybe?)

One possible way to update the model could be adding this in update_prompt_params function:

dockers = Krita.instance().dockers()
for d in dockers:
    if d.objectName() == TAB_SDCOMMON:
    d.page_widget.sd_model_layout.qcombo.setEditText(params[keys[0]])
    break
ElliottLester commented 1 year ago

@JasonS09 So I wrote a replacement for craft_response() that formalizes the response class and pushes some code out of client.py Let me know if you think this is the right direction? There are some TODOs in this PR I would like your thoughts on. client.py:224 prompt.py

Other Querys?

JasonS09 commented 1 year ago
  • I would like to move the workflow generation code out of client.py I'm thinking Prompt.to_workflow()

Go for it.

ElliottLester commented 1 year ago

I have removed all the base64 conversions in the response section. I think I'll check this in before moving onto the Prompt/config side.