mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-05-06 23:32:30 +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…
Reference in New Issue
Block a user