Comments (3)
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.
from if.
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.
from if.
No luck on an M1.
ysctl hw | grep BF16
returns
hw.optional.arm.FEAT_BF16: 0
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):
pip install deepfloyd_if==1.0.2rc0
pip install xformers==0.0.16
pip install git+https://github.com/openai/CLIP.git --no-deps
pip install protobuf==3.20.3
from if.
Related Issues (20)
- How to download the model to local use? HOT 3
- How to Change Settings in Google Colab
- How to convert DeepFloyd model to onnx
- ImportError: cannot import name 'CLIPImageProcessor' from 'transformers'
- Null
- What is the FID-30K test subset? HOT 2
- Is the paper going to be released?
- Dedicated Inpainting Model
- Can only run locally? Can't you run on the server and ubuntu?
- Tensor error for basic example usage HOT 3
- Internal: unk is not defined HOT 3
- Error related to Transformers version when launching HOT 1
- There has a path bug in stage_III_sd_x4 file.
- Citation Information HOT 2
- Variance Scheduler HOT 2
- what is bs_scale for?
- ValueError: CLIPVisionModelWithProjection does not support `device_map='auto'`. To implement support, the model class needs to implement the `_no_split_modules` attribute. HOT 6
- OOM appears using DeepFloyd_IF (I use 32G video memory) HOT 3
- can the huggingface repository be un-gated?
- Fine Tuning
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from if.