sd-webui-controlnet icon indicating copy to clipboard operation
sd-webui-controlnet copied to clipboard

[Bug]: Running `/controlnet/txt2img` and then `/sdapi/v1/txt2img` causes unexpected results

Open entmike opened this issue 1 year ago • 2 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits of both this extension and the webui

What happened?

Running /controlnet/txt2img and then /sdapi/v1/txt2img causes the results to contain the last ControlNet settings to still be present. For example, if you run a simple /controlnet/txt2img with canny model and modules enabled with a reference image of a couch, it works as expected (a new couch composition image.) However if you then want to run a normal /sdapi/v1/txt2img call something like "fiery dragon", the couch composition remains. Almost like the controlnet call left something behind.

Steps to reproduce the problem

  1. Run a simple /controlnet/txt2img API call with canny model and modules enabled with a reference image of a couch or whatever
  2. Run a normal /sdapi/v1/txt2img call something like "fiery dragon", observe the visible remains of the reference composition of the controlnet call in step 1.

What should have happened?

/sdapi/v1/txt2img should have returned a fiery dragon not in the composition of a couch.

Commit where the problem happens

  • webui: 0cc0ee1bcb4c24a8c9715f66cede06601bfc00c8
  • controlnet: 0c45b5ad6b9482e8e4eb580fd69b11bbe482c5d2

What browsers do you use to access the UI ?

Brave

Command Line Arguments

--listen --no-half --xformers --enable-insecure-extension-access \
--api --no-download-sd-model --api-log --enable-console-prompts


### Console logs

```Shell
There is no unusual console output.

Additional information

No response

entmike avatar Feb 26 '23 20:02 entmike

~~#384 might fix this.~~

Ah this might be caused by the model not being unloaded. We need to run the controlnet script in normal txt2img route to give a chance to the extension to reset the model, or something like that.

ljleb avatar Feb 26 '23 20:02 ljleb

~#384 might fix this.~

Ah this might be caused by the model not being unloaded. We need to run the controlnet script in normal txt2img route to give a chance to the extension to reset the model, or something like that.

Actually, on a whim I tried this again after incorporating a change discussed here: https://github.com/Mikubill/sd-webui-controlnet/issues/347#issuecomment-1444647723 - This seems to have corrected this behavior. I'll leave this open until someone closes in case this warrants any further discussion or visibility!

entmike avatar Feb 26 '23 20:02 entmike