soten355 / MetalDiffusion

Stable Diffusion for Intel and Silicon Mac's. Forked from @divamgupta's work
Other
67 stars 5 forks source link

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

Open raffetazarius opened 6 months ago

raffetazarius commented 6 months ago

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'
soten355 commented 6 months ago

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.

soten355 commented 6 months ago

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

raffetazarius commented 6 months ago

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 % 
soten355 commented 5 months ago

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
raffetazarius commented 5 months ago

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?

soten355 commented 5 months ago

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.

raffetazarius commented 5 months ago

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.

raffetazarius commented 5 months ago

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?