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

No module named 'inpaint'. Some issue with generating inpainted mesh #453 [proposed fix] #473

Open
themanyone opened this issue Oct 15, 2024 · 0 comments

Comments

@themanyone
Copy link

themanyone commented Oct 15, 2024

Steps to reproduce
go to 'inpaint' tab and Generate 3D inpainted mesh

$ sysinfo 
CPU: quad core Intel Core i7-2860QM (-MT MCP-) speed/min/max: 968/800/3600 MHz
Kernel: 6.10.12-100.fc39.x86_64 x86_64 Up: 2d 18h 56m
Mem: 15.85/31.28 GiB (50.7%) Storage: 1.86 TiB (26.8% used) Procs: 403
Shell: Bash inxi: 3.3.34
  File "/home/k/Downloads/src/stable-diffusion-webui/extensions/stable-diffusion-webui-depthmap-script/src/core.py", line 355, in run_3dphoto
    from inpaint.mesh import write_mesh
ModuleNotFoundError: No module named 'inpaint'

$ g "issue with" * -r
extensions/stable-diffusion-webui-depthmap-script/src/core.py:334:            print(f'{str(e)}, some issue with generating inpainted mesh')
# TODO: This should not be here
if inp[go.GEN_INPAINTED_MESH]:
    try:
        mesh_fi = run_3dphoto(device, inpaint_imgs, inpaint_depths, inputnames, outpath,
                              inp[go.GEN_INPAINTED_MESH_DEMOS],
                              1, "mp4")
        yield 0, 'inpainted_mesh', mesh_fi
    except Exception as e:
        print(f'{str(e)}, some issue with generating inpainted mesh')

backbone.reload_sd_model()
print("All done.\n")

def run_3dphoto(device, img_rgb, img_depth, inputnames, outpath, gen_inpainted_mesh_demos, vid_ssaa, vid_format):
    from inpaint.mesh import write_mesh
    from inpaint.networks import Inpaint_Color_Net, Inpaint_Depth_Net, Inpaint_Edge_Net
    from inpaint.bilateral_filtering import sparse_bilateral_filtering
$ where inpaint
./extensions/stable-diffusion-webui-depthmap-script/inpaint
n extensions/stable-diffusion-webui-depthmap-script/src/core.py:334:

FIX#1. Path issue

$ cd ./extensions/stable-diffusion-webui-depthmap-script
$ ln -s $(pwd)/inpaint ../../

hmm
So I run python and try stepping through

>>>   from inpaint.mesh import write_mesh
>>>    from inpaint.networks import Inpaint_Color_Net, Inpaint_Depth_Net, Inpaint_Edge_Net
SyntaxError: trailing comma not allowed without surrounding parentheses

Fix#2. Put parenthesis around imports around line ~355
from inpaint.networks import (Inpaint_Color_Net, Inpaint_Depth_Net, Inpaint_Edge_Net)

I also removed the try...catch block. It doesn't really do anything but hide errors.

@themanyone themanyone changed the title No module named 'inpaint'. Some issue with generating inpainted mesh #453 again No module named 'inpaint'. Some issue with generating inpainted mesh #453 [proposed fix] Oct 15, 2024
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

1 participant