以下の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)