Comments (2)
Hi @zakrzewki! Thanks for reaching out.
The problem is in diffusers
as you stated, not in diffusers-interpret
. diffusers==0.3.0
no longer loads models correctly from HuggingFace Hub.
I took a look and it would take a lot of effort to change this package to now work with a new version of diffusers. I'm can do it, but after some months HuggingFace will change diffusers
again, and it will no longer be compatible.
The only real scalable solution is to have them slightly change the package as I mentioned here, and then do the according changes in this package.
from diffusers-interpret.
If you just want a quick and dirty solution, you cane edit /usr/local/lib/python3.10/dist-packages/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py
:
- remove line 6 that imports
preprocess_mask
- create the preprocess_mask in that file:
def preprocess_mask(mask):
mask = mask.convert("L")
w, h = mask.size
w, h = map(lambda x: x - x % 32, (w, h)) # resize to integer multiple of 32
mask = mask.resize((w // 8, h // 8), resample=PIL.Image.NEAREST)
mask = np.array(mask).astype(np.float32) / 255.0
mask = np.tile(mask, (4, 1, 1))
mask = mask[None].transpose(0, 1, 2, 3) # what does this step do?
mask = 1 - mask # repaint white, keep black
mask = torch.from_numpy(mask)
return mask
I don't guarantee that StableDiffusionPipelineExplainer
will work 100% though, because the API versions no longer match.
from diffusers-interpret.
Related Issues (8)
- Website for documentation HOT 2
- cannot import name '_png' from 'matplotlib' HOT 2
- Update diffusers-interpret to work with the latest diffusers package (0.8.0) HOT 7
- How to cite HOT 2
- TypeError HOT 1
- The Colab Notebook cannot be opened HOT 2
- StableDiffusionPipelineExplainer enable_attention_slicing() and limit token attribution HOT 4
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 diffusers-interpret.