stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

Add inpaint arguments and json format in .txt file

Open Jibaku789 opened this issue 1 year ago • 1 comments

Description

Issue:

While working and reproduce images generated using img2img inpaint tab, there are options that are not exported After try to generate the same images the options:

  • inpaint_full_res_padding
  • inpaint_full_res
  • inpaint_mask_invert
  • inpainting_mask_invert
  • inpainting_fill

Also since i am adding more field to the generated .txt file, to improve the visibility of the options i added a new config parameter to export the file in json format

Solution:

  • Add missing options to inpainting images generated
  • Add new options to export .txt files in json format

Screenshots/videos:

UI functionality

Normal output

Inpaint1

JSON output

Inpaint2

Ruff

ruff

Tests

test

Checklist:

Jibaku789 avatar Dec 19 '23 20:12 Jibaku789

@AUTOMATIC1111 may you kindly review?

Jibaku789 avatar Dec 22 '23 21:12 Jibaku789

This PR has multiple unrelated things:

  • adding missing infotext fields for img2img: this is welcome, but see below.
  • adding an option to write infotext as json: I do not want multiple formats for infotext, so this change will not make it in.

Now, when adding infotext fields, you need both code to add them, and to read from them. You only have former.

The preferred way to add infotext fields it to use p.extra_generation_params dictionary, and not inside create_infotext function, but rather where they are used, i.e. in StableDiffusionProcessingImg2Img.__init__.

The other thing that needs to be done and isn't, is to add support for reading those fields into UI. See, for example, how mask_blur component does it.

AUTOMATIC1111 avatar Dec 30 '23 12:12 AUTOMATIC1111

Thanks for the comment, i will take a look

Jibaku789 avatar Dec 30 '23 16:12 Jibaku789