3DCG屋さんの活動記録

PROFILE ★★こんな人です

3DCGを活用した映像や没入体験コンテンツの制作をしています。テクノロジーの社会実装に興味があり。テクニカルディレクター。面白いこと新しいことにワクワクする気持ちに『素直』でいつづける。

2022年9月14日水曜日

StableDiffusionをローカル環境で試す


・StableDiffusionを回数気にせず試したい!

・機械学習についてPythonとともに学びたい!


ということで、トライしたところ

なんとか開発環境構築が終わり、ローカルで何回でもStableDiffusionを使えるようになった!

たので備忘録メモ!




■事前チェック

CUDA 11.6をインストール済み



■Python3.9インストール

C:\Users\{userName}\AppData\Local\Programs\Python\Python39

 (デフォルトのまま)



■仮想環境

任意のフォルダに仮想環境を構築(今回はC:\Python39)

>cd C:\Python39

>py -3.9 -m venv my_venv


■パッケージインストール

仮想環境にインストールしたいので、


まず仮想環境への切り替え(仮想環境 .venv ディレクトリのactivate.batを実行)

>C:\Python39\my_venv\Scripts\activate.bat


この状態で、まず pip upgrade。

(.venv) >C:\Python39\my_venv\Scripts\python.exe -m pip install --upgrade pip


続けて、pipでインストール。 ※仮想環境を作ったときのバージョンになる

(.venv) >python -m pip install <package name>


・PyTorch

(.venv) >python -m pip install torch


・Transformers【仮想環境にインストール推奨】

(.venv) >python -m pip install tranformers


・Diffusers【仮想環境にインストール推奨】

(.venv) >python -m pip install diffusers


■Diffusersの動作確認

pythonをコピペして、仮想環境で実行→OK


■StableDiffusionの動作確認

Pythonをコピペして、仮想環境で実行 →OK !簡単


もし、PyTorchエラーがでたら、PyTrochを入れ直してみる。

・PyTorch入れ直し

(my_venv) >pip list

で +cu116 が入っていないものをアンインストール

(my_venv) >pip uninstall torch

つづけてインストールし直し。

(my_venv) >pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116

※https://pytorch.org/



--------------

StableDiffusionのテストPython



============================================

■参考サイト(諸先輩の説明に感謝)

・ローカル環境でStableDiffusionを実行する

https://self-development.info/%E3%80%90%E7%B0%A1%E5%8D%98%E3%80%91%E3%83%AD%E3%83%BC%E3%82%AB%E3%83%AB%E7%92%B0%E5%A2%83%E3%81%A7stable-diffusion%E3%81%A7%E5%AE%9F%E8%A1%8C%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95/

・DreamStudio金額は?

https://ciclo.jp/dreamstudio/

・Prompt参考(lexica)

https://lexica.art/?q=city++siver&prompt=d9b2c577-5083-4b76-9de0-e01117682f56

・Promptまとめ 

https://golabo.net/stable-diffusion-command/

2022年9月1日木曜日

TortoiseGit で初Push ~デフォルトブランチ名は master じゃなくて main !


備忘録

 GitHubで、初めてちゃんとリポジトリをプッシュしてみた。


■やったこと

・GitHubでリポジトリ作成

・TortoiseGitでクライアント側操作

・ローカルのフォルダ&ファイルをリモートリポジトリに反映



■重要 事前設定変更

TortoiseGitのSettigsで、デフォルトブランチ名を「master」→「main」に変更。





■【手順】ローカルのフォルダをリモートリポジトリにする

管理したいローカルのフォルダ名を使って、Gitにリポジトリ作成。

 →ここでURLコピーしておく(Code。httpからOK、gitからNG)


ローカルのフォルダで右クリックして「Git create repository here」

 →.gitのフォルダが作成される

 ※まだここでは反映していない


ローカルのフォルダで右クリックして「Commit」。 

 チェック入れて、コメント入れて、「Commit&Push」

 ここで、URLを聞かれるので以下の通り回答。

 URL入れるダイアログで 「Manage」ボタン押す。

 →次のダイアログのURLにURL入れる。(httpからの)

 →AddNew/Save

 →OK 

 →OK

 →Close

以上で、GitHub のリポジトリ確認すれば、ローカルのファイルがアップ(Push)されています!




■【手順】リモートリポジトリをローカルフォルダに反映

①ローカルフォルダで右クリック「Git Clone...」

 →事前にフォルダは空にしておく


②URLを聞かれるので、リモートリポジトリのURLをコピペ

 →Directoryはフォルダを新規作成するか決める


以上。




■個人的ポイント

・Commit&Push をつかう

・プルリクエスト  ←全体にプッシュしたこと伝える



2022年8月30日火曜日

Midjourneyで田園風景を生成してみた


 前回の初使用「Midjourneyで日本の神社画像を生成してみるテスト」に続き、

AI画像生成テスト第2段!試したメモ。

・・・・・無料残り回数7回!


「広葉樹林の山にそびえたつ和風木造建築」で生成した画像。




■個人的に好きな絵に近づくPrompt

・日本的な森
many mountains of landscape with broadleaf forest,old forest,

・高解像度でフォトリアル
hyperdimensional photography, hyper realistic,

・田んぼ道
long road between rice garden, 

・夏の雲
large beautifull clouds in summer,





■Test画像とPrompt

hyperdimensional photography,huge structure, realistic, cinematic,Landscape with broadleaf forest, bright daytime, birds flying, pleasant breeze, ancient forest, huge Japanese-style wooden structure towering over the landscape,--aspect 7:3 


(version3)


hyperdimensional photography,huge structure to the cosmo, ultrarealistic, cinematic,Landscape with broadleaf forest, bright daytime, little birds flying near camera, pleasant breeze, ancient forest, playing dogs,huge Japanese-style wooden structure towering over the landscape,--aspect 7:3


(version3)


hyperdimensional photography, ultrarealistic, cinematic, landscape with broadleaf forest, bright daylight with strong sunlight, small bird flying near camera, pleasant breeze, old forest, dog playing in front of camera, huge Japanese style wooden structure reaching to the sky in the landscape,spaceship docked next to villa built by aliens, -- Aspect ratio 7:3


hyperdimensional photography, cinematic, landscape with broadleaf forest its roundly, bright daylight with strong sunlight, small bird flying in the high sky, pleasant breeze, old forest,  Japanese style huge wooden structure reaching to the sky in the landscape,kawaii spaceship docked next to villa built by aliens, -- Aspect ratio 7:3



hyperdimensional photography, ultrarealistic,  landscape with broadleaf forest its roundly, bright daylight with strong sunlight, small bird flying in the high sky, pleasant breeze, old forest,  Japanese style huge and high wooden structure reaching to the sky in the traditional japanese-style garden,villa built by aliens,kawaii spaceship going on there,  -- Aspect ratio 7:3



hyperdimensional photography, ultrarealistic,  many mountains of landscape with broadleaf forest , bright daylight with strong sunlight, many small birds flying in the high sky,large beautifull clouds in summer, old forest,  Japanese style huge and high wooden structure reaching to the sky ,long road between rice garden -- Aspect ratio 7:3



hyperdimensional photography, hyper realistic,  many mountains of landscape with broadleaf forest , bright daylight with strong sunlight, many small birds flying in the high sky,large beautifull clouds in summer, old forest,  huge Japanese-style wooden structure towering over the landscape,long road between rice garden, --ar 7:3


(version3)






2022年8月28日日曜日

Midjourneyで日本の神社画像を生成してみる テスト


 初めて本格的にMidjourneyを使ってみた。


「美しい雲の切れ間から光が差し込む神社」で生成した画像。







以下備忘録メモ。


このページを参考に始めた。

https://ciclo.jp/midjourney-discord/



PCにDicordをインストール。

グループに参加。


そして、 /imagine つかって指示。

指示の出し方はこちら参考にさせてもらいました、まじ感謝。

https://note.com/shi3zblog/n/n9e3976f0c7f4




/info で残り時間を確認。



アスペクト比をデフォルトの1:1から変更

https://trpg-japan.com/knowledge/how-to-use-midjourney/



高解像度にする

https://mutsumutsu-daifuku.com/howto-midj/

Uボタン→ もしくはコマンドでできた。



■個人的メモ

・高解像度の写真風 冒頭に追加

hyperdimensional photography of


・ジブリ風 末尾に

in Hayao Miyazaki style


■最後に、テスト画像を貼ります

A detailed oli painting of organic shaped photorealistic view of an old shrine and its torii (torii gate) in a rural area  in Hayao Miyazaki style



A detailed oli painting of photorealistic view of an old japanese shrine and its torii (torii gate) at a rural area forest  in Hayao Miyazaki style



Walking down the road of  old japanese shrine's precincts ,over the torii (torii gate) , at sunrise, many birds flying,very beautiful clouds,between  komainu  ,Rural landscape with rice fields,A mountain of broad-leaved forest spreads out



camera lens 12mm super wide, Walking down the road of  old large shrine's precincts its japanese style over the small torii , at sunrise, many birds flying,very beautiful clouds,between  komainu  ,Rural landscape with rice fields,A mountain of broad-leaved forest spreads out, run and playing children,pop color 




Walking down the road of  old japanese jinja,with  the small torii , at sunrise, many birds flying,very beautiful clouds ,showa age with rice fields,A mountain of broad-leaved forest spreads out,  Japanese people smiling and greeting each other as they work the farm.



Izumo-taisha shrine illuminated by light shining through a beautiful gap in the clouds,  people are lining up to worship, very large pine trees are lining the road, far landscape is several mountains of hardwood trees are lined up side by side, in the magic hour 


Izumo-taisha shrine illuminated by light shining through a beautiful gap in the clouds,  people are lining up to worship, very large pine trees are lining the road, far landscape is several mountains of hardwood trees are lined up side by side, in the magic hour ::  in Hayao Miyazaki style, --aspect 9:19





hyperdimensional photography of Izumo-taisha shrine illuminated by light shining through a beautiful gap in the large clouds,  people are lining up to worship, very large pine trees are lining the road, far landscape is several mountains of hardwood trees are lined up side by side, in the magic hour new year, with high buildingth future



hyperdimensional photography of  Izumo-taisha shrine illuminated by light shining through a beautiful gap in the clouds,  people are lining up to worship, very large pine trees are lining the road, far landscape is several mountains of hardwood trees are lined up side by side, in the magic hour,  --aspect 2.35:1






2022年8月14日日曜日

MPK mini mk3 購入してGetできるInstrumentをMPCのPluginで使う方法


 

MPK mini Software managerでインストール。

AdvanceModeで起動すると、Plugin項目が出てくる。

インストール。


MPC beat 起動して、Edit/Preference/Pluginsで

以下フォルダを指定してScanNewする


C:\Program Files\AIR Music Tech

C:\Program Files\Steinberg\vstplugins




すると、

Pluginの選択画面に VST が表示されて選択できるようになる


参考

https://youtu.be/E0iTpDk_DJY?t=175


2022年8月13日土曜日

UnrealEngineのカメラ制御、をMIDIキーボード&バリアントマネージャで効率化


 やったこと備忘録

カメラをMIDIで制御

VariantManagerでカメラアングルセット作成、切り替えれるように登録

それをMIDIで制御


①UEでMIDIの受信

②PlayせずにEditorでMIDI受信

③アクターをMIDIで制御

④LevelVariantSetの切り替えをMIDIで制御 ★


以上



参考

②について

https://www.youtube.com/watch?v=cdIm-ZthUsk

2022年7月20日水曜日

UEでLive Link Faceをつかってフェイシャルキャプチャ


UEで window/Live Link を起動しても
iPhoneのSubjectが認識されない。。。


そんなときは2点試してみて。

①有線PCと無線スマホが同一ネットワークにない?
 隔離機能、ネットワーク分離 ←なってたらNG.

②ファイアーウォール設定
 以下でアプリケーションを許可して下さい。


UE4.27
→C:\Program Files\Epic Games\UE_4.27\Engine\Binaries\Win64\UE4Editor.exe

UE5.0
→C:\Program Files\Epic Games\UE_5.0\Engine\Binaries\Win64\UnrealEditor.exe


以上でLiveLinkで認識されるはず。

※UE5でLiveLinkのパネルはここから



うまくいけば、iPhoneで顔をキャプチャした瞬間に
LiveLinkパネルにSubjectが表示されます。


GOOD!!!!!