🖼️

texture-diffusionでテクスチャを生成してみる

2023/05/18に公開

概要

AIの画像生成で3Dモデルで使用できるテクスチャの生成をためしてみます

今回は以前導入したstable-diffusion-webuiを使用します
※ 他の方法やサービスについては下の方にまとめてます
https://zenn.dev/szgk/articles/f7ddbd07bc50de

texture-diffusion

https://civitai.com/models/15873/texture-diffusion

後述する dream-textures というblenderで使えるアドオンのために作られたモデルらしい
HuggingFaceではダウンロード方法が分からなかったがcivitaiからダウンロードできた
サイズは2.4GB

出力結果

試しにモデルをそのまま使って下記のプロンプトで出力
red stone wall seemless texture for 3d model
ちゃんとシームレスになってて感動

このサイトでノーマル、ディスプレイメント、アンビエント、スペキュラーマップに変換できました
https://cpetry.github.io/NormalMap-Online/

参考: https://www.youtube.com/watch?v=hNFz0Mlj5Dc


いろいろ試した

※ no watar mark は邪悪な気がするのでご使用は自己責任で

建物系は得意そう

seemless texture of glass wall
ネガティブプロンプトgradation, black frame, stone
seemless texture of shutter wall, {{no watar mark}}, {{no white noise}}ネガティブプロンプト gradation, black frame, stone, point of edge, {{watar mark}} wood seemless texture

動物系は苦手

calico cat fur seemless texture, soft, brown, white, black seamless texture of dog fur Create a lifelike and seamless dog fur texture that emulates the rich textures and patterns found in various dog breeds, achieving a true-to-life representation of their unique coat characteristics.

Prompt Hunt というサイトからpromptを持ってきて試してみる
右端は草原を出そうとしたけどどうやっても緑の壁紙にしかならない…

Earthen walls, tiles, for game, texture, seamless pattern exture tile tiled, hand paint, ice with stone, environment, texture for games, texture for 3d seemless texture, tileable real grass, 4k, top down

機械っぽいのを試す
いうほどシームレスじゃないけどこれは得意なのかもしれない

seemless texture of green neon light, sci-fi, mechanical,
ネガティブプロンプト gradation
seemless texture of electronic circuit, sci-fi, mechanical
ネガティブプロンプト gradation
seemless texture of electronic circuit, sci-fi, mechanical
ネガティブプロンプトgradation, black space, black line

テキスタイルもいける

seemless texture of camouflage, military, {{no watar mark}}, {{no white noise}}
ネガティブプロンプト gradation, black frame, stone, point of edge, {{watar mark}}
seemless texture of colorful patchwork, {{no watar mark}}, {{no white noise}},
ネガティブプロンプト gradation, black frame, stone, point of edge, {{watar mark}}, {{white noise}}, {{noise}}
seemless texture of colorfull patchwork, pastel color, fantasic, {{no watar mark}}, {{no white noise}}
ネガティブプロンプト gradation, black frame, stone, point of edge, {{watar mark}}, {{white noise}}, {{noise}}

その他テクチャ生成ツール・サービス

  • Freeのゲーム用テクスチャが生成できるWebサービス
  • NMKD Stable Diffusion GUI
    • GUI でstable diffusionを使えるツール
    • ゲームのシームレスなテクスチャを生成するオプションがあるらしい
  • dream-textures

所感

  • 無機物(建物、模様)はいける
  • 有機物(動物、草)は苦手
  • そもそもが背景モデル用のテクスチャを学習している気がする
    • 動物の毛皮とか植物に絞ったLoRaを作成したら有機物もいけるかもしれない

Discussion