2024/09/27(金) [n年前の日記]
#1 [cg_tools] 拡張機能 sd_lama_cleaner の動作確認中
_昨日
に引き続き、Stability Matrix経由で起動した Stable Diffusion web UI 上で、ブラシで塗った場所を消去してくれる拡張機能 sd_lama_cleaner をインストール中。
_GitHub - aka7774/sd_lama_cleaner: Lama Cleaner 1111 Extension for Windows
環境は Windows10 x64 22H2。
LamaCleanerタブ → StartボタンをクリックしてもDOS窓が開かなかったのだけど、.pyファイルを直接書き換えたら動くようになった。
(Stable Diffusion WebUIインストールフォルダ)\extensions\sd_lama_cleaner\scripts\lama_cleaner_tab.py を、以下のように編集した。
オリジナル版では、「start venv/Scripts/lama-cleaner --model=lama --device=cpu --port=7870」を呼び出すようにしているけれど。lama-cleaner.exe のある場所を絶対指定で求めて呼び出すようにしている。
本来、Start Command の入力欄に lama-cleaner.exe の場所を記述してやれば、件の入力欄を編集した段階で、その内容が (Stable Diffusion WebUIインストールフォルダ)\extensions\sd_lama_cleaner\start_cmd.txt に保存されて、次回の起動からその内容が反映されるはずなのだけど…。何故かWebブラウザ(Google Chrome、Firefox)の入力欄にはその変更が全く反映されず、デフォルトの文字列だけが残り続けてる。しかし、内部的には反映されていて、Startボタンをクリックすれば lama-cleaner.exe が起動してくれる模様。
_GitHub - aka7774/sd_lama_cleaner: Lama Cleaner 1111 Extension for Windows
環境は Windows10 x64 22H2。
LamaCleanerタブ → StartボタンをクリックしてもDOS窓が開かなかったのだけど、.pyファイルを直接書き換えたら動くようになった。
(Stable Diffusion WebUIインストールフォルダ)\extensions\sd_lama_cleaner\scripts\lama_cleaner_tab.py を、以下のように編集した。
--- lama_cleaner_tab.py.orig Wed Sep 25 21:59:39 2024
+++ lama_cleaner_tab.py Fri Sep 27 18:08:26 2024
@@ -40,10 +40,12 @@
command = f.read()
print(command)
elif os.name == 'nt':
- command = 'start venv/Scripts/lama-cleaner --model=lama --device=cpu --port=7870'
+ cmdpath = os.path.normpath(os.path.join(dir, "../../venv/Scripts/lama-cleaner.exe")).replace("\\", "/")
+ command = f"start \"{cmdpath}\" --model=lama --device=cuda --port=7870"
else: # posix
command = 'venv/bin/lama-cleaner --model=lama --device=cpu --port=7870'
+ print(f"lama-cleaner : command = {command}")
return command
def get_open_command():
オリジナル版では、「start venv/Scripts/lama-cleaner --model=lama --device=cpu --port=7870」を呼び出すようにしているけれど。lama-cleaner.exe のある場所を絶対指定で求めて呼び出すようにしている。
本来、Start Command の入力欄に lama-cleaner.exe の場所を記述してやれば、件の入力欄を編集した段階で、その内容が (Stable Diffusion WebUIインストールフォルダ)\extensions\sd_lama_cleaner\start_cmd.txt に保存されて、次回の起動からその内容が反映されるはずなのだけど…。何故かWebブラウザ(Google Chrome、Firefox)の入力欄にはその変更が全く反映されず、デフォルトの文字列だけが残り続けてる。しかし、内部的には反映されていて、Startボタンをクリックすれば lama-cleaner.exe が起動してくれる模様。
[ ツッコむ ]
以上、1 日分です。