diff --git a/backend/nodes/image_nodes.py b/backend/nodes/image_nodes.py index 3a6b8c7f1..1e974df6b 100644 --- a/backend/nodes/image_nodes.py +++ b/backend/nodes/image_nodes.py @@ -443,13 +443,17 @@ def run( imgs = [] max_h, max_w, max_c = 0, 0, 1 for img in im1, im2, im3, im4: - if img is not None: + if img is not None and type(img) != str: h, w = img.shape[:2] c = img.shape[2] or 1 max_h = max(h, max_h) max_w = max(w, max_w) max_c = max(c, max_c) imgs.append(img) + # dirty fix for problem with optional inputs and them just being positional + # TODO: make the inputs named instead of positional + elif type(img) == str and img in ["horizontal", "vertical"]: + orientation = img fixed_imgs = [] for img in imgs: diff --git a/src/helpers/hooks/useSystemUsage.js b/src/helpers/hooks/useSystemUsage.js index 0fed81101..449abd72e 100644 --- a/src/helpers/hooks/useSystemUsage.js +++ b/src/helpers/hooks/useSystemUsage.js @@ -21,8 +21,12 @@ const useSystemUsage = (delay) => { }); // GPU/VRAM - const vramPercent = await ipcRenderer.invoke('get-vram-usage'); - setVramUsage(vramPercent); + try { + const vramPercent = await ipcRenderer.invoke('get-vram-usage'); + setVramUsage(vramPercent); + } catch (_) { + // Sometimes this will fire before it's done registering the event handlers + } }; useEffect(() => {