[Osaka/Yokohama] Looking for infrastructure/server side engineers!

[Osaka/Yokohama] Looking for infrastructure/server side engineers!

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Successor to CentOS] AlmaLinux OS server construction/migration service

[Successor to CentOS] AlmaLinux OS server construction/migration service

[For WordPress only] Cloud server “Web Speed”

[For WordPress only] Cloud server “Web Speed”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Reservation system development] EDISONE customization development service

[Reservation system development] EDISONE customization development service

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[Global exclusive service] Beyond's MSP in North America and China

[Global exclusive service] Beyond's MSP in North America and China

[YouTube] Beyond official channel “Biyomaru Channel”

[YouTube] Beyond official channel “Biyomaru Channel”

【Stable Diffusion】話題の画像生成AIを使って、ゴッホにハムスターを描いてもらった

こんにちは。
最近腰を痛めているシステムソリューション部のかわです。

あけましておめでとうございます。2023年ですね。

なんとなくみなさんも感じてるかもですが、振り返ると2022年って、
いろんな技術がどんどん出た年だった気がします。
特にAI技術、知らないうちにものすごく進化してきてるんやなーと。
労働者がいらなくなるかも的な意味でちょっと恐怖も感じたりしますよね。

ということで、じぶんも使われる側より使う側になるためにもAI技術を学ぼうと思いまして

このビヨンドブログ一覧のサムネイル画像なんですが、
実はこれAIに生成してもらいました。
スペースハムスター、宇宙ハム。

夏頃リリースされて話題になった Stable Diffusion という画像生成AIを使って、
びっくりするほど簡単に宇宙ハムができちゃいました。
かがくのちからってすげー

もしも巨匠がハムスターを描いたら

少し前に「もしもゴッホが暴走族を描いたら」シリーズが盛り上がってましたが、
今回はハムスターを描かせてみたいと思います。

"a painting of a hamster in Van Gogh style"

ゴッホ。
"The Starry Night"感出てますね

"an impressionistic painting of a hamster in Monet style

モネ。印象派のいい味が出てますね。
ちなみにこの記事のトップ画もモネで、そっちは「impressionism」の語を外したバージョン。

a picture of a hamster in Hokusai style

葛飾北斎。
和な感じが出ますねえ

"a painting of a hamster in the style of Piccasso's Guernica"

最後はピカソ。
ゲルニカ感出せましたね

で、どうやってるの?

詳しくは調べていただくといろんなやり方が出てくるんですが、今回はGPUではなくCPUをフルに使ったUbuntu環境でやってます。
生成には学習データに基づいたモデルを使用するので、Hugging FaceさんのStable-Diffusion-v-1-4モデルを使わせてもらいました。
(悪意のあるものや他人へ害を与えるようなコンテンツ以外なら商用利用もOKという太っ腹なライセンス)

プロンプトのコツ

思ったような画像を出力させるには、プロンプトの文を工夫する必要があります。

例えば↓のハムスター(??)、

"space hamster"
で出力した画像なんですが、表現が抽象的すぎると勝手にモデルから組み合わせて独自の解釈で生成してしまうので、
ハムスターの体を成していないものが生まれたりと、意図した結果にならんことが多いです。
なので、宇宙にいるハムスターを表現したい場合は
"a hamster in space"
とかにするとちょっと良くなるかも。
(昔やった「どこで誰が何してるゲーム」をイメージするとわかりやすいです)

他にもイメージを具体化するための表現として、
"in Van Gogh style" または "in the style of Van Gogh" (ゴッホ風の)
"a painting of" (~の絵)
"a photograph of" (~の写真)
"abstruct" (抽象画)

とかが使えます。

例:
"a painting of Tokyo Sky Tree in Renoir style"

"a painting of Tokyo Sky Tree in Van Gogh style"

みなさんもお試しあれ

この記事がお役に立てば【 いいね 】のご協力をお願いいたします!
13
読み込み中...
13 票, 平均: 1.00 / 113
3,767
X facebook はてなブックマーク pocket
[2024.6.30 CentOS support ended] CentOS server migration solution

[2024.6.30 CentOS support ended] CentOS server migration solution

[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[Osaka/Yokohama] Actively recruiting infrastructure engineers and server side engineers!

[Osaka/Yokohama] Actively recruiting infrastructure engineers and server side engineers!

The person who wrote this article

About the author

Kawa Ken


A curious Poke○n who belongs to the System Solution Department.