KutsuyaYuki / ABG_extension

228 stars 23 forks source link

How to use the script in WEBUI? #2

Closed Starlento closed 1 year ago

Starlento commented 1 year ago

I do not find a way to directly use this script on input image in img2img. It is always triggering the img2img normal algorithm. If the script does not prevent that, how to do the same task of the huggingface API in WEBUI?

Swayerka commented 1 year ago

I do not find a way to directly use this script on input image in img2img. It is always triggering the img2img normal algorithm. If the script does not prevent that, how to do the same task of the huggingface API in WEBUI?

You have to use Depth model (like this) and set Denoising strength to 0

Gargantuanman commented 1 year ago

Does anyone know where to find the yalm file of that model in order to load onto webui?

Starlento commented 1 year ago

Does anyone know where to find the yalm file of that model in order to load onto webui?

There is guide in webui WIKI for SD 2.0: https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Features#depth-guided-model. And the file link: https://raw.githubusercontent.com/Stability-AI/stablediffusion/main/configs/stable-diffusion/v2-midas-inference.yaml

Gargantuanman commented 1 year ago

thank you, but seems that someting is off on the file:

Loading weights [59cb052d44] from C:\stable-diffusion-webui\models\Stable-diffusion\512-depth-ema.safetensors changing setting sd_model_checkpoint to 512-depth-ema.safetensors: RuntimeError Traceback (most recent call last): File "C:\stable-diffusion-webui\modules\shared.py", line 536, in set self.data_labels[key].onchange() File "C:\stable-diffusion-webui\modules\call_queue.py", line 15, in f res = func(*args, **kwargs) File "C:\stable-diffusion-webui\webui.py", line 84, in shared.opts.onchange("sd_model_checkpoint", wrap_queued_call(lambda: modules.sd_models.reload_model_weights())) File "C:\stable-diffusion-webui\modules\sd_models.py", line 428, in reload_model_weights load_model(checkpoint_info) File "C:\stable-diffusion-webui\modules\sd_models.py", line 385, in load_model load_model_weights(sd_model, checkpoint_info) File "C:\stable-diffusion-webui\modules\sd_models.py", line 241, in load_model_weights model.load_state_dict(sd, strict=False) File "C:\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1604, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for LatentDiffusion: size mismatch for model.diffusion_model.input_blocks.0.0.weight: copying a param with shape torch.Size([320, 5, 3, 3]) from checkpoint, the shape in current model is torch.Size([320, 4, 3, 3]).