Skip to content

Trying to convert Float8_e4m3fn to the MPS backend but it does not have support for that dtype. #8988

Description

@jainamnahar14surat

Custom Node Testing

Expected Behavior

The image generation should be happen

Actual Behavior

It is always giving error while loading the model. It is due to the unsupported data type float8 over mac

Steps to Reproduce

Just run the main.py on the any macOS

Debug Logs

# ComfyUI Error Report
## Error Details
- **Node ID:** 31
- **Node Type:** KSampler
- **Exception Type:** TypeError
- **Exception Message:** Trying to convert Float8_e4m3fn to the MPS backend but it does not have support for that dtype.

## Stack Trace
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jainamnahar/Documents/GitHub/ComfyUI/comfy/ldm/flux/model.py", line 113, in forward_orig
    img = self.img_in(img)
          ^^^^^^^^^^^^^^^^
  File "/Users/jainamnahar/Documents/GitHub/ComfyUI/venv/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1751, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jainamnahar/Documents/GitHub/ComfyUI/venv/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1762, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jainamnahar/Documents/GitHub/ComfyUI/comfy/ops.py", line 84, in forward
    return self.forward_comfy_cast_weights(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jainamnahar/Documents/GitHub/ComfyUI/comfy/ops.py", line 375, in forward_comfy_cast_weights
    weight, bias = cast_bias_weight(self, input)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jainamnahar/Documents/GitHub/ComfyUI/comfy/ops.py", line 51, in cast_bias_weight
    bias = comfy.model_management.cast_to(s.bias, bias_dtype, device, non_blocking=non_blocking, copy=has_function, stream=offload_stream)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jainamnahar/Documents/GitHub/ComfyUI/comfy/model_management.py", line 1017, in cast_to
    return weight.to(dtype=dtype, copy=copy)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Trying to convert Float8_e4m3fn to the MPS backend but it does not have support for that dtype.

2025-07-21T14:27:55.849065 - Prompt executed in 0.04 seconds

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions