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