mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-09-13 16:27:10 +08:00
Discard response object after use
This commit is contained in:
parent
668d6382d8
commit
5ae97051bc
@ -21,8 +21,8 @@ class LoadImageUrl:
|
||||
CATEGORY = "image"
|
||||
|
||||
def load_image(self, url):
|
||||
r = request.urlopen(url)
|
||||
i = Image.open(r)
|
||||
with request.urlopen(url) as r:
|
||||
i = Image.open(r)
|
||||
image = i.convert("RGB")
|
||||
image = np.array(image).astype(np.float32) / 255.0
|
||||
image = torch.from_numpy(image)[None,]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user