LoginSignup
3
1

More than 1 year has passed since last update.

Waifu DiffusionのOpen in Colabが動かない場合の対処方法

Posted at

以下のOpen in Colabが動かない場合の対処方法。

ImportError: Please install the `accelerate` library to use Diffusers with PyTorch. You can do so by running `pip install diffusers[torch]`. Or if torch is already installed, you can run `pip install accelerate`.

0.7.0でaccelerateが必要になった模様。

なので、エラーメッセージのとおり diffusers

!pip install transformers gradio scipy ftfy "ipywidgets>=7,<8" datasets diffusers

diffusers[torch] に変えてやればOK。

!pip install transformers gradio scipy ftfy "ipywidgets>=7,<8" datasets diffusers[torch]

KeyError: 'sample'

0.3.0で、出力が "sample" から "images" に変更されている(正直、このあたりのインターフェースをコロコロ変えるのはやめてほしい)。

なので、ここを

images = pipe([prompt] * num_samples, guidance_scale=7.5)["sample"]

以下のように変えればOK。

images = pipe([prompt] * num_samples, guidance_scale=7.5)["images"]

gradio.appのリンクが出ない

Colabの仕様変更と思われる。

ここを、

demo.launch(debug=True)

こうすればリンクが出るようになる。

demo.launch(debug=True, share=True)
3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1