Instructions to use hakurei/waifu-diffusion with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use hakurei/waifu-diffusion with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("hakurei/waifu-diffusion", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps
- Draw Things
- DiffusionBee
i got error '' cannot import name 'CLIPVisionModelWithProjection' from 'transformers ''
i tried to construct it in my drive and it occured. pls teach me how to solve it...
ImportError Traceback (most recent call last)
in
2 import torch
3 from torch import autocast
----> 4 from diffusers import StableDiffusionPipeline
5
6 model_id = "hakurei/waifu-diffusion"
3 frames
/usr/local/lib/python3.7/dist-packages/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_image_variation.py in
20 import PIL
21 from diffusers.utils import is_accelerate_available
---> 22 from transformers import CLIPFeatureExtractor, CLIPVisionModelWithProjection
23
24 from ...models import AutoencoderKL, UNet2DConditionModel
ImportError: cannot import name 'CLIPVisionModelWithProjection' from 'transformers' (/usr/local/lib/python3.7/dist-packages/transformers/init.py)
error full text
I had the same error. Installing the latest version of transformers from source resolved the issue:
pip install git+https://github.com/huggingface/transformers
Same issue,
I've already update transformers and still get an error.
Can anybody help me with that?
I have the same traceback as in previous message
pip install -U transformers
same problem even after upgrading it is not working
I got the same problem , still