-
Notifications
You must be signed in to change notification settings - Fork 497
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does it work on M1? #17
Comments
I saw jsindy on the IF Discord (April 28) state that they got it working (slowly?) on Mac and posted what I assume to be the Python inference code. I don't know enough about Python to make use of it, though. I've got an M2 Max with 64 GB unified memory and think that, barring heavy quantization, the Mac is probably the ideal consumer platform to run IF. I just wish there were more evidence of people working on it. I just don't have the expertise or time. |
No luck on an M1.
returns
So FEAT_BF16 is not supported on M1 but required by the model. A full example you can try on your M2: from deepfloyd_if.modules import IFStageI, IFStageII, StableStageIII
from deepfloyd_if.modules.t5 import T5Embedder
from huggingface_hub import login
from deepfloyd_if.pipelines import dream
login("<your hugginface token>", True)
device = 'mps'
if_I = IFStageI('IF-I-XL-v1.0', device=device)
if_II = IFStageII('IF-II-L-v1.0', device=device)
if_III = StableStageIII('stable-diffusion-x4-upscaler', device=device)
t5 = T5Embedder(device="cpu")
prompt = 'ultra close-up color photo portrait of rainbow owl with deer horns in the woods'
count = 1
result = dream(
t5=t5, if_I=if_I, if_II=if_II, if_III=if_III,
prompt=[prompt]*count,
seed=42,
if_I_kwargs={
"guidance_scale": 7.0,
"sample_timestep_respacing": "smart100",
},
if_II_kwargs={
"guidance_scale": 4.0,
"sample_timestep_respacing": "smart50",
},
if_III_kwargs={
"guidance_scale": 9.0,
"noise_level": 20,
"sample_timestep_respacing": "75",
},
)
if_III.show(result['III'], size=14) If you don't have enough RAM, you can also try with the only if_I. This is the setup (python 3.10.11 installed with pyenv):
|
https://github.com/brkirch/DeepFloyd-IF-example-Mac It will require 64 GB of RAM due to the Diffusers SD x4 upscaler pipeline being very memory inefficient on MPS. Only using the stage I and stage II models requires 32 GB. |
No description provided.
The text was updated successfully, but these errors were encountered: