Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Add PatchFusion Depth Estimation #392

Open
petermg opened this issue Jan 6, 2024 · 11 comments
Open

[Feature Request] Add PatchFusion Depth Estimation #392

petermg opened this issue Jan 6, 2024 · 11 comments

Comments

@petermg
Copy link

petermg commented Jan 6, 2024

Would be cool to have this added:
https://github.com/zhyever/PatchFusion

I've been running it locally on it's own. Would be nice to have it incorporated into this extension.
https://huggingface.co/spaces/zhyever/PatchFusion

However a couple of modifications may need to be made to get it to work, same ones I had to make. Found here:
Fannovel16/comfyui_controlnet_aux#2 (comment)

to fix this: file /comfyui_controlnet_aux/src/controlnet_aux/zoe/zoedepth/models/base_models/midas.py replace line 176 with

return nn.functional.interpolate(x, (int(height), int(width)), mode='bilinear', align_corners=True)

file /comfyui_controlnet_aux/src/custom_midas_repo/midas/backbones/beit.py replace line 47 with

new_sub_table = F.interpolate(old_sub_table, size=(int(new_height), int(new_width)), mode="bilinear")

The line location was different on mine and so was the path to the two files but their paths showed up in the errors that came up. Once I found this solution, it was simple to implement.

@semjon00
Copy link
Collaborator

semjon00 commented Jan 6, 2024

I too hope somebody can implement this :)

@graemeniedermayer
Copy link
Contributor

Do you have an estimate on your local memory usage? I was kind of hoping they would make some memory optimisations before we implemented it. I'm thinking about doing some cloud gpu stuff next week so might have some time to implement it.

@petermg
Copy link
Author

petermg commented Jan 6, 2024

Do you have an estimate on your local memory usage? I was kind of hoping they would make some memory optimisations before we implemented it. I'm thinking about doing some cloud gpu stuff next week so might have some time to implement it.

Running it right now, Task Manager is showing Python using 1.7GB of RAM.

@graemeniedermayer
Copy link
Contributor

That can be right while the algorithm is running? I'm pretty sure it should be at least 10GB.

@petermg
Copy link
Author

petermg commented Jan 6, 2024

image
It BRIEFLY got up to 2.4GB, but as you can see from this screenshot, my GPU is maxed out while the system RAM is at 1.7GB.

@graemeniedermayer
Copy link
Contributor

Oh no that's the RAM I meant the VRAM. I'll just try with a big gpu.

@petermg
Copy link
Author

petermg commented Jan 6, 2024

Oh no that's the RAM I meant the VRAM. I'll just try with a big gpu.

Sorry, stupid question I know, but how can I tell? I've got MSI afterburner installed but I'm not sure if I can use that for this since it's not using a graphics API window. My GPU is a 4090 with 24GB of VRAM.

@petermg
Copy link
Author

petermg commented Jan 6, 2024

image
image
image
Ok, the first image is without it running, my GPU VRAM is at 11GB. Then with it running it goes up to just over 15GB, then briefly at the end it jumps up to just over 20GB. So you were correct. Around 10GB of VRAM it seems.

@graemeniedermayer
Copy link
Contributor

Nice thank you!

@petermg
Copy link
Author

petermg commented Jan 6, 2024

Nice thank you!

No problem! Would be very nice to be able to have this in this extension :)

@graemeniedermayer
Copy link
Contributor

graemeniedermayer commented Jan 15, 2024

https://github.com/graemeniedermayer/stable-diffusion-webui-normalmap-script/tree/patchfusion
I have the start of it here but there's a surprising amount of compatibility issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants