thygate / stable-diffusion-webui-depthmap-script

High Resolution Depth Maps for Stable Diffusion WebUI
MIT License
1.72k stars 159 forks source link

Error during inpainted mesh generation "missing node" #160

Open Lalimec opened 1 year ago

Lalimec commented 1 year ago

I am having some kind of error at the mesh geenration stage. I was able to generate one mesh prior to this one but couldn't managed to create another. Images I've used have the same dimensions and such, around 1024px, nothing much. What could be the issue, is it relatred to memory leak stuff?

DepthMap v0.3.8
device: cuda
Loading model weights from  ./models/leres/res101.pth
initialize network with normal
loading the model from ./models/pix2pix/latest_net_G.pth
Computing depthmap(s) ..
  0%|                                                     | 0/1 [00:00<?, ?it/s]

wholeImage being processed in : 1568
Adjust factor is: 1.0
Selecting patches ...
Target resolution:  (3136, 2566, 3)
Resulting depthmap resolution will be : (1408, 1152)
patches to process: 17
         processing patch 0 / 16 | [   0  151 1006 1006]
         processing patch 1 / 16 | [   0  302 1006 1006]
         processing patch 2 / 16 | [158 158 991 991]
         processing patch 3 / 16 | [158 309 991 991]
         processing patch 4 / 16 | [ 50 503 905 905]
         processing patch 5 / 16 | [201 503 905 905]
         processing patch 6 / 16 | [  0 302 704 704]
         processing patch 7 / 16 | [  0 453 704 704]
         processing patch 8 / 16 | [  0 603 704 704]
         processing patch 9 / 16 | [460 309 690 690]
         processing patch 10 / 16 | [460 460 690 690]
         processing patch 11 / 16 | [460 611 690 690]
         processing patch 12 / 16 | [ 50 805 603 603]
         processing patch 13 / 16 | [  0 453 402 402]
         processing patch 14 / 16 | [  0 603 402 402]
         processing patch 15 / 16 | [  0 754 402 402]
         processing patch 16 / 16 | [  0 905 402 402]
100%|█████████████████████████████████████████████| 1/1 [00:11<00:00, 11.09s/it]
Done.
Running 3D Photo Inpainting ..
Loading edge model ..
Loading depth model ..
Loading rgb model ..
  0%|                                                     | 0/1 [00:00<?, ?it/s]
Generating inpainted mesh .. (go make some coffee) ..

fill missing node =  60 1211                               | 0/7 [00:00<?, ?it/s]
> /home/ubuntu/stable-diffusion-webui/extensions/stable-diffusion-webui-depthmap-script/scripts/inpaint/mesh_tools.py(525)fill_missing_node()
-> re_depth, re_count = 0, 0
(Pdb)
thygate commented 1 year ago

It's breaking into the pdb debugger because of the code at mesh_tools.py(525), which requests it. import pdb; pdb.set_trace()

I must not have ran into that function before (fill_missing_node) since i did not encounter this..

Try removing that line in scripts/inpaint/mesh_tools.py, line 525.

You can also continue the pdb debugger by typing 'continue' on the (Pdb) command line.

Lalimec commented 1 year ago

ok so typed "continue" and it is resuming. Why all of a sudden it started to go into the debugger, did i break sth?

thygate commented 1 year ago

That code was specifically put in place to break into the debugger when it entered a certain path by the original developers. Possibly this path is still buggy. The image and depth map you're using must have triggered this situation (fill missing node).