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

The controlnet_aux.hed dependency has been updated! The Network class is no longer available. I changed Network to ControlNetHED_Apache2 to adapt to the new version. #238

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions hugginggpt/server/models_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from controlnet_aux import OpenposeDetector, MLSDdetector, HEDdetector, CannyDetector, MidasDetector
from controlnet_aux.open_pose.body import Body
from controlnet_aux.mlsd.models.mbv2_mlsd_large import MobileV2_MLSD_Large
from controlnet_aux.hed import Network
from controlnet_aux.hed import ControlNetHED_Apache2
from transformers import DPTForDepthEstimation, DPTFeatureExtractor
import warnings
import time
Expand Down Expand Up @@ -279,8 +279,10 @@ def mlsd_control_network():
model.load_state_dict(torch.load(f"{local_fold}/lllyasviel/ControlNet/annotator/ckpts/mlsd_large_512_fp32.pth"), strict=True)
return MLSDdetector(model)


hed_network = Network(f"{local_fold}/lllyasviel/ControlNet/annotator/ckpts/network-bsds500.pth")
model_path = f"{local_fold}/lllyasviel/ControlNet/annotator/ckpts/ControlNetHED.pth"
hed_network = ControlNetHED_Apache2()
hed_network.load_state_dict(torch.load(model_path, map_location="cpu"))
hed_network.float().eval()

controlnet_sd_pipes = {
"openpose-control": {
Expand Down Expand Up @@ -632,4 +634,4 @@ def models(model_id):
if not os.path.exists("public/videos"):
os.makedirs("public/videos")

waitress.serve(app, host="0.0.0.0", port=port)
waitress.serve(app, host="0.0.0.0", port=port)