LoginSignup
0
0

DatabricksでOpenDalleV1.1を動かしてみる

Last updated at Posted at 2024-01-05

画像系生成AIにも食指を。ライセンスはNon-Commercial Personal Use License Agreementなのでご注意ください。

GPUクラスターを準備します。
Screenshot 2024-01-05 at 10.12.04.png

ライブラリのインストール。

%pip install -U diffusers transformers accelerate
dbutils.library.restartPython()
from diffusers import AutoPipelineForText2Image
import torch
        
pipeline = AutoPipelineForText2Image.from_pretrained('dataautogpt3/OpenDalleV1.1', torch_dtype=torch.float16).to('cuda')        
image = pipeline('black fluffy gorgeous dangerous cat animal creature, large orange eyes, big fluffy ears, piercing gaze, full moon, dark ambiance, best quality, extremely detailed').images[0]
image

おおー。
cat.png

なお、画像はノートブックにレンダリングされるので確認が楽です。
Screenshot 2024-01-05 at 10.36.10.png

別のプロンプトで。

image = pipeline('2 birds facing each other. The one is white crow. The another one is red love bird').images[0]
image

若干解釈が混じっているようですが、これはこれで面白い。
birds.png

日本語プロンプトだとなかなか難しいです。

image = pipeline('賑わっている動物園').images[0]
image

賑わっている?動物園?
zoo.png

しかし、去年はMidJorneyなどを触って一喜一憂していた訳ですが、今では無料のモデルでこういうことができるようになったんだなとしみじみ感じる年始です。

Databricksクイックスタートガイド

Databricksクイックスタートガイド

Databricks無料トライアル

Databricks無料トライアル

0
0
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
0
0