filipstrand/mflux

TypeError: unsupported operand type(s) for |: 'type' and 'NoneType' when importing / running a command

Closed this issue · 1 comments

I installed mflux as per the readme instructions i.e.:

  • mkdir -p mflux && cd mflux && python3 -m venv .venv && source .venv/bin/activate
  • pip install -U mflux

I get an error when running the example mflux-generate --model schnell --prompt "Luxury food photograph" --steps 2 --seed 2 -q 8 or simply from mflux.flux.flux import Flux1 in a Python script:

Traceback (most recent call last):
  File "/Users/pelayomartinez/Documents/Code/notebooks/mflux/flux.py", line 1, in <module>
    from mflux.flux.flux import Flux1
  File "/Users/pelayomartinez/Documents/Code/notebooks/mflux/.venv/lib/python3.9/site-packages/mflux/flux/flux.py", line 14, in <module>
    from mflux.models.vae.vae import VAE
  File "/Users/pelayomartinez/Documents/Code/notebooks/mflux/.venv/lib/python3.9/site-packages/mflux/models/vae/vae.py", line 4, in <module>
    from mflux.models.vae.decoder.decoder import Decoder
  File "/Users/pelayomartinez/Documents/Code/notebooks/mflux/.venv/lib/python3.9/site-packages/mflux/models/vae/decoder/decoder.py", line 7, in <module>
    from mflux.models.vae.common.unet_mid_block import UnetMidBlock
  File "/Users/pelayomartinez/Documents/Code/notebooks/mflux/.venv/lib/python3.9/site-packages/mflux/models/vae/common/unet_mid_block.py", line 5, in <module>
    from mflux.models.vae.common.resnet_block_2d import ResnetBlock2D
  File "/Users/pelayomartinez/Documents/Code/notebooks/mflux/.venv/lib/python3.9/site-packages/mflux/models/vae/common/resnet_block_2d.py", line 7, in <module>
    class ResnetBlock2D(nn.Module):
  File "/Users/pelayomartinez/Documents/Code/notebooks/mflux/.venv/lib/python3.9/site-packages/mflux/models/vae/common/resnet_block_2d.py", line 17, in ResnetBlock2D
    conv_shortcut_in: int | None = None,
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

Never mind. The issue was my Python Version. Needs at least Python 3.10 to work