Spaces:
Runtime error
Runtime error
hysts commited on
Commit ·
02c2b6d
1
Parent(s): b2c2519
Update
Browse files2 unmodified lines3456782 unmodified lines11121314151617181920212223242526272 unmodified linesfrom __future__ import annotationsimport osimport shleximport subprocess2 unmodified linesif os.getenv('SYSTEM') == 'spaces':with open('patch') as f:subprocess.run(shlex.split('patch -p1'), stdin=f, cwd='ControlNet')commands = ['wget https://huggingface.co/ckpt/ControlNet/resolve/main/dpt_hybrid-midas-501f0c75.pt -O dpt_hybrid-midas-501f0c75.pt','wget https://huggingface.co/ckpt/ControlNet/resolve/main/body_pose_model.pth -O body_pose_model.pth','wget https://huggingface.co/ckpt/ControlNet/resolve/main/hand_pose_model.pth -O hand_pose_model.pth','wget https://huggingface.co/ckpt/ControlNet/resolve/main/mlsd_large_512_fp32.pth -O mlsd_large_512_fp32.pth','wget https://huggingface.co/ckpt/ControlNet/resolve/main/mlsd_tiny_512_fp32.pth -O mlsd_tiny_512_fp32.pth','wget https://huggingface.co/ckpt/ControlNet/resolve/main/network-bsds500.pth -O network-bsds500.pth','wget https://huggingface.co/ckpt/ControlNet/resolve/main/upernet_global_small.pth -O upernet_global_small.pth',]for command in commands:subprocess.run(shlex.split(command), cwd='ControlNet/annotator/ckpts/')from gradio_canny2image import create_demo as create_demo_cannyfrom gradio_depth2image import create_demo as create_demo_depth2 unmodified lines34567892 unmodified lines12131415161718192021222324252627282930313233342 unmodified linesfrom __future__ import annotationsimport osimport pathlibimport shleximport subprocess2 unmodified linesif os.getenv('SYSTEM') == 'spaces':with open('patch') as f:subprocess.run(shlex.split('patch -p1'), stdin=f, cwd='ControlNet')base_url = 'https://huggingface.co/lllyasviel/ControlNet/resolve/main/annotator/ckpts/'names = ['body_pose_model.pth','dpt_hybrid-midas-501f0c75.pt','hand_pose_model.pth','mlsd_large_512_fp32.pth','mlsd_tiny_512_fp32.pth','network-bsds500.pth','upernet_global_small.pth',]for name in names:command = f'wget https://huggingface.co/lllyasviel/ControlNet/resolve/main/annotator/ckpts/{name} -O {name}'out_path = pathlib.Path(f'ControlNet/annotator/ckpts/{name}')if out_path.exists():continuesubprocess.run(shlex.split(command), cwd='ControlNet/annotator/ckpts/')from gradio_canny2image import create_demo as create_demo_cannyfrom gradio_depth2image import create_demo as create_demo_depth
37 unmodified lines3839404142434437 unmodified lines'depth': 'control_sd15_depth.pth','normal': 'control_sd15_normal.pth',}ORIGINAL_WEIGHT_ROOT = 'https://huggingface.co/ckpt/ControlNet/resolve/main/'LIGHTWEIGHT_MODEL_NAMES = {'canny': 'control_canny-fp16.safetensors',37 unmodified lines3839404142434437 unmodified lines'depth': 'control_sd15_depth.pth','normal': 'control_sd15_normal.pth',}ORIGINAL_WEIGHT_ROOT = 'https://huggingface.co/lllyasviel/ControlNet/resolve/main/models/'LIGHTWEIGHT_MODEL_NAMES = {'canny': 'control_canny-fp16.safetensors',
app.py+18-11
model.py+1-1