Skip to content

Commit 5efe5bd

Browse files
committed
environment upadate, typo correct
1 parent 2f64bdc commit 5efe5bd

File tree

5 files changed

+4
-3
lines changed

5 files changed

+4
-3
lines changed

annotator/hed/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def __init__(self):
9090
self.netNetwork = ControlNetHED_Apache2().float().cuda().eval()
9191
self.netNetwork.load_state_dict(torch.load(modelpath))
9292

93-
def __call__(self, input_image, safe=False):
93+
def __call__(self, input_image, safe=False, threshold=200):
9494
assert input_image.ndim == 3
9595
H, W, C = input_image.shape
9696
with torch.no_grad():
@@ -106,7 +106,7 @@ def __call__(self, input_image, safe=False):
106106
edge = (edge * 255.0).clip(0, 255).astype(np.uint8)
107107

108108
content_image = edge
109-
content_image[content_image > 200] = 255
109+
content_image[content_image > threshold] = 255
110110
content_image[content_image < 255] = 0
111111
kernel = np.ones((3,3), np.uint8)
112112

assets/image_driven.png

-40.9 MB
Loading

assets/text_driven.png

-26.5 MB
Loading

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ accelerate==0.21.0
88
opencv-python==4.8.1.78
99
einops==0.7.0
1010
botocore==1.34.68
11+
gradio==3.41.2
1112
basicsr

styleshot_image_driven_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def main(args):
2828
raise ValueError("Invalid preprocessor")
2929

3030
if not os.path.isdir(styleshot_model_path):
31-
styleshot_lineart_model_path = snapshot_download(styleshot_model_path, local_dir=styleshot_model_path)
31+
styleshot_model_path = snapshot_download(styleshot_model_path, local_dir=styleshot_model_path)
3232
print(f"Downloaded model to {styleshot_model_path}")
3333

3434
# weights for ip-adapter and our content-fusion encoder

0 commit comments

Comments
 (0)