soten355/MetalDiffusion

Mac Intel with AMD GPU: AttributeError: 'NoneType' object has no attribute 'save'

Opened this issue · 8 comments

I'm able to load up the Metal Diffusion UI and start generating, however just before the image is generated I get this error and then cannot generate again.

 currentInputFrame.save(f"debug/frameAfterWarpBeforeInference_{frameNumber:05}.png", format = "png")
    ^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'save'

I'm happy to help! It looks like you're doing an animation. What are you settings? How did you get here? I'd like to recreate this bug.

Oh wait, I found it. I've fixed the dream.py file. Replace it with the new one and this error should go away.

Now when I try to run

python dream.py (with your new dream.py updated 50 mins ago)

I get:

privateuser@Mac-Pro MetalDiffusion % python dream.py
Traceback (most recent call last):
  File "/Users/privateuser/MetalDiffusion/dream.py", line 5, in <module>
    from rich import print, box
ModuleNotFoundError: No module named 'rich'
privateuser@Mac-Pro MetalDiffusion % 

Seems like you don't have the proper libraries installed in your venv. It also looks like you're not running within a virtual environment. I suggest checking that rich has been installed or just installing it:

python pip install rich

What if i only wish to install rich in the venv but not system-wide?

or do i need it at the system level for Metal Diffusion?

Rich should be installed in your virtual environment.

You should be working within a virtual environment the entire time with MetalDiffusion. It seems like you aren't running the program in the virtual environment, which could explain the errors your having.

How do I run dream.py within the virtual environment? The dream.py file is installed to the MetalDiffusion/ folder by default when cloning your repo. Should I be cd'ing into the /venv/ subfolder first and then trying to run dream.py from.there? There is no dream.py file in the venv folder that I can see.

Ah, I think I may just have to activate the Python venv

source venv/bin/activate

EVERY time before I run

python dream.py

is that it?

Not really clear based on https://github.com/soten355/MetalDiffusion/wiki/Starting-MetalDiffusion - perhaps you could update these instructions?