You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I switched the SamLoader as you suggested and set to CPU, but I also switched from ComfyUI Embedded to ComfyUI.exe Desktop Version 1, I don't know if this switch will have an impact or not. Also am not sure if the checkpoint that I was using could impact these error, I ran 200 image generations with JuggernautXL_juggXI which so far hasn't produced an error. When using PhotopediaXL_45 checkpoint it produces the error report below, not sure if it's being poorly built and that's the reason for producing these error's or it's a wider issue. It's also the same checkpoint used that produced the previous ComfyUI Error Report (Comfy Embedded), not sure if it's a checkpoint issue but when I switch out the checkpoint to JuggernautXL_juggXI the process queue is executed fully.
ComfyUI Error Report
Error Details
Node ID: 476
Node Type: FaceDetailerPipe
Exception Type: torch.OutOfMemoryError
Exception Message: Allocation on device
Stack Trace
File "C:\Users\MSI-Graphics\AppData\Local\Programs\@comfyorgcomfyui-electron\resources\ComfyUI\execution.py", line 327, in execute
output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\MSI-Graphics\AppData\Local\Programs\@comfyorgcomfyui-electron\resources\ComfyUI\execution.py", line 202, in get_output_data
return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\MSI-Graphics\AppData\Local\Programs\@comfyorgcomfyui-electron\resources\ComfyUI\execution.py", line 174, in _map_node_over_list
process_inputs(input_dict, i)
File "C:\Users\MSI-Graphics\AppData\Local\Programs\@comfyorgcomfyui-electron\resources\ComfyUI\execution.py", line 163, in process_inputs
results.append(getattr(obj, func)(**inputs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\ComfyUI-Desktop-V1\custom_nodes/comfyui-impact-pack\modules\impact\impact_pack.py", line 1438, in doit
enhanced_img, cropped_enhanced, cropped_enhanced_alpha, mask, cnet_pil_list = FaceDetailer.enhance_face(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\ComfyUI-Desktop-V1\custom_nodes/comfyui-impact-pack\modules\impact\impact_pack.py", line 559, in enhance_face
sam_mask = core.make_sam_mask(sam_model_opt, segs, image, sam_detection_hint, sam_dilation,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\ComfyUI-Desktop-V1\custom_nodes/comfyui-impact-pack\modules\impact\core.py", line 732, in make_sam_mask
detected_masks = sam_obj.predict(image, points, plabs, dilated_bbox, threshold)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\ComfyUI-Desktop-V1\custom_nodes/comfyui-impact-pack\modules\impact\core.py", line 603, in predict
predictor.set_image(image, "RGB")
File "E:\ComfyUI-Desktop-V1\.venv\Lib\site-packages\segment_anything\predictor.py", line 60, in set_image
self.set_torch_image(input_image_torch, image.shape[:2])
File "E:\ComfyUI-Desktop-V1\.venv\Lib\site-packages\torch\utils\_contextlib.py", line 116, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "E:\ComfyUI-Desktop-V1\.venv\Lib\site-packages\segment_anything\predictor.py", line 89, in set_torch_image
self.features = self.model.image_encoder(input_image)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\ComfyUI-Desktop-V1\.venv\Lib\site-packages\torch\nn\modules\module.py", line 1739, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\ComfyUI-Desktop-V1\.venv\Lib\site-packages\torch\nn\modules\module.py", line 1750, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\ComfyUI-Desktop-V1\.venv\Lib\site-packages\segment_anything\modeling\image_encoder.py", line 112, in forward
x = blk(x)
^^^^^^
File "E:\ComfyUI-Desktop-V1\.venv\Lib\site-packages\torch\nn\modules\module.py", line 1739, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\ComfyUI-Desktop-V1\.venv\Lib\site-packages\torch\nn\modules\module.py", line 1750, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\ComfyUI-Desktop-V1\.venv\Lib\site-packages\segment_anything\modeling\image_encoder.py", line 174, in forward
x = self.attn(x)
^^^^^^^^^^^^
File "E:\ComfyUI-Desktop-V1\.venv\Lib\site-packages\torch\nn\modules\module.py", line 1739, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\ComfyUI-Desktop-V1\.venv\Lib\site-packages\torch\nn\modules\module.py", line 1750, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\ComfyUI-Desktop-V1\.venv\Lib\site-packages\segment_anything\modeling\image_encoder.py", line 234, in forward
attn = add_decomposed_rel_pos(attn, q, self.rel_pos_h, self.rel_pos_w, (H, W), (H, W))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\ComfyUI-Desktop-V1\.venv\Lib\site-packages\segment_anything\modeling\image_encoder.py", line 358, in add_decomposed_rel_pos
attn.view(B, q_h, q_w, k_h, k_w) + rel_h[:, :, :, :, None] + rel_w[:, :, :, None, :]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
I posted this a week ago with the error being produce again after your fix for #32 not sure what is happening can you please advise, unable to show this error on #32 as ticket was closed.
Zandebar
changed the title
FaceDetailerPipe: torch.OutOfMemoryError - Allocation on device-2 - Desktop-V1
Again - FaceDetailerPipe: torch.OutOfMemoryError - Allocation on device-2 - Desktop-V1
Feb 19, 2025
I switched the SamLoader as you suggested and set to CPU, but I also switched from ComfyUI Embedded to ComfyUI.exe Desktop Version 1, I don't know if this switch will have an impact or not. Also am not sure if the checkpoint that I was using could impact these error, I ran 200 image generations with JuggernautXL_juggXI which so far hasn't produced an error. When using PhotopediaXL_45 checkpoint it produces the error report below, not sure if it's being poorly built and that's the reason for producing these error's or it's a wider issue. It's also the same checkpoint used that produced the previous ComfyUI Error Report (Comfy Embedded), not sure if it's a checkpoint issue but when I switch out the checkpoint to JuggernautXL_juggXI the process queue is executed fully.
Originally posted by @Zandebar in #32
The text was updated successfully, but these errors were encountered: