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

fix: include_init_images missing from StableDiffusionProcessingImg2Img

Open moonshinegloss opened this issue 2 years ago • 13 comments

The missing include_init_images causes painthua to crash; I could not find a reason this would have been removed on purpose, especially with tests still supplying that value: https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/828438b4a190759807f9054932cae3a8b880ddf1/test/img2img_test.py#L43

This PR adds it back with a default False as seen here:

https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/828438b4a190759807f9054932cae3a8b880ddf1/modules/api/models.py#L109

moonshinegloss avatar Nov 23 '22 16:11 moonshinegloss

Does processing.py:739 need to be patched as well to pass through the arg?

georgzoeller avatar Nov 25 '22 11:11 georgzoeller

git history shows this was never added to img2img processing class in the first place and i'm sure it's not supposed to go there in the first place. In fact, tests still complete properly with both "include_init_images": True and "include_init_images": False.

AUTOMATIC1111 avatar Nov 27 '22 11:11 AUTOMATIC1111

git history shows this was never added to img2img processing class in the first place and i'm sure it's not supposed to go there in the first place. In fact, tests still complete properly with both "include_init_images": True and "include_init_images": False.

This is interesting, I have a crash on image2image that necessitates adding include_init_images: bool=False to the arglist in line 737 of processing.py to fix image

This is coming through the img2img api in api.py

I'm on origin master image

georgzoeller avatar Nov 27 '22 15:11 georgzoeller

If I try adding this change manually, I get this error on startup:

Embeddings: ERROR: [Errno 10048] error while attempting to bind on address ('0.0.0.0', 16996): only one usage of each socket address (protocol/network address/port) is normally permitted

I'm using these args:

Launching Web UI with arguments: --listen --port 16996 --api --cors-allow-origins=https://www.painthua.com

The error is only seen after making the changes in this commit.

That would be you running another instance of webui while the old one is still running and blocking the port ;)

georgzoeller avatar Nov 28 '22 09:11 georgzoeller

-->It was...which is why I deleted the comment, in the hope nobody would see me for the fool I am 😉

GalaxyTimeMachine avatar Nov 28 '22 10:11 GalaxyTimeMachine

git history shows this was never added to img2img processing class in the first place and i'm sure it's not supposed to go there in the first place. In fact, tests still complete properly with both "include_init_images": True and "include_init_images": False.

This happens when the user is using some extensions such as sd-dynamic-prompts.

And I confirmed that this pull can fix it.

BlinkDL avatar Nov 28 '22 11:11 BlinkDL

I can confirm that manually making this change in the file resolves the problem.

GalaxyTimeMachine avatar Nov 28 '22 11:11 GalaxyTimeMachine

This happens when the user is using some extensions such as sd-dynamic-prompts.

I'm also hitting this error when using the API and having sd-dynamic-prompts installed.

mike-hearn avatar Nov 28 '22 19:11 mike-hearn

Getting the error that this would fix (painthua) when trying to add to an image created. generating in painthua works fine unless there is overlap with another image if there is over lap then i get the crash that includes: TypeError: StableDiffusionProcessing.__init__() got an unexpected keyword argument 'include_init_images'

Given the frequency of automatic1111 updates (in this ever changing world of ai stuff thats to be expected and not moaning about it) I am reluctant to edit files. Can this fix not be brought into the main branch? does it negatively affect anything?

ghost avatar Dec 01 '22 18:12 ghost

git history shows this was never added to img2img processing class in the first place and i'm sure it's not supposed to go there in the first place. In fact, tests still complete properly with both "include_init_images": True and "include_init_images": False.

This happens only when the user is using sd-dynamic-prompts .

Please run img2img_test.py with sd-dynamic-prompts installed and you might see the same error.

BlinkDL avatar Dec 02 '22 19:12 BlinkDL

just to confirm the fix works

so here is me doing a video for the painthua developer to show the issue clearer than i could in text https://www.youtube.com/watch?v=_IrQ0eygfiw

during the video he pinged me some possible solutions to fix it...which i tried to no avail.

he then asked me to try the fix here...I was reluctant to edit my files as i know how swift the development moves...but was willing to do it as a test...

https://www.youtube.com/watch?v=siRaWaHvDoE

as you can see its a success.

Is there a reason the two line hasnt been merged? it seems a simple solution but i am gessing there is a reason?

ghost avatar Dec 02 '22 19:12 ghost

This fix worked for me. I just edited my file by hand -- I'll deal with a merge conflict later while updating lol

Sirfrummel avatar Dec 09 '22 04:12 Sirfrummel

with the https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/b2f17dd367c5758e406dd22b78ad7456dac1957a commit the problem should be gone.

AUTOMATIC1111 avatar Dec 10 '22 06:12 AUTOMATIC1111