CVE-2022-38023適用後 NetAppがActive Directoryに参加できない

いままでも「SMB2 Enabled for DC Connections設定に起因する接続できない問題」というのがあったが、先日話題になった「Active Directoryサーバのセキュリティ強化アップデート(CVE-2022-38023)に伴うONTAPファイルサーバへの影響」で、2023年7月以降のActive Directory環境ではONTAP をCIFSに新規作成しようとした場合にエラーがでる、という問題が出ていた。

Is AES Encryption Enabled設定」と「AES session key enabled for NetLogon channel設定」の2つの設定を変更する必要がある。

前者はONTAP 9.12.1から初期値変更、後者はONTAP 9.10.1から初期値変更となっているので、最近導入している場合は問題が発生しないのだが、以前のバージョンからアップデートしているような環境の場合は以前の値のままとなっているため注意が必要となっている。

その1: Is AES Encryption Enabled 設定

以前からONTAPを使っていてアップデートしているような環境では、SMB内部接続での暗号化形式でAESを使わない、という設定になっているせいで、下記の様なエラーとなる。

1netapp9101::> vserver cifs create -vserver svm3 -cifs-server svm3 -domain adosakana.local
2 
3In order to create an Active Directory machine account for the CIFS server, you must supply the name and password of a Windows account with
4sufficient privileges to add computers to the "CN=Computers" container within the "ADOSAKANA.LOCAL" domain.
5 
6Enter the user name: administrator
7 
8Enter the password:
9 
10Error: Machine account creation procedure failed
11  [    47] Loaded the preliminary configuration.
12  [   130] Created a machine account in the domain
13  [   130] SID to name translations of Domain Users and Admins
14           completed successfully
15  [   131] Successfully connected to ip 172.17.44.49, port 88 using
16           TCP
17  [   142] Successfully connected to ip 172.17.44.49, port 464 using
18           TCP
19  [   233] Kerberos password set for 'SVM3$@ADOSAKANA.LOCAL' succeeded
20  [   233] Set initial account password
21  [   244] Successfully connected to ip 172.17.44.49, port 445 using
22           TCP
23  [   276] Successfully connected to ip 172.17.44.49, port 88 using
24           TCP
25  [   311] Successfully authenticated with DC
26           adserver.adosakana.local
27  [   324] Unable to connect to NetLogon service on
28           adserver.adosakana.local (Error:
29           RESULT_ERROR_GENERAL_FAILURE)
30**[   324] FAILURE: Unable to make a connection
31**         (NetLogon:ADOSAKANA.LOCAL), result: 3
32  [   324] Unable to make a NetLogon connection to
33           adserver.adosakana.local using the new machine account
34  [   346] Deleted existing account
35           'CN=SVM3,CN=Computers,DC=adosakana,DC=local'
36 
37Error: command failed: Failed to create the Active Directory machine account "SVM3". Reason: general failure.
38 
39netapp9101::>

この問題はマニュアルの「Enable or disable AES encryption for Kerberos-based communication」に記載されているように「is-aes-encryption-enabled」設定をtrueに変更することで解決する。

1netapp9101::> vserver cifs security modify -vserver svm3 -is-aes-encryption-enabled true
2netapp9101::> vserver cifs security show -fields is-aes-encryption-enabled
3vserver is-aes-encryption-enabled
4------- -------------------------
5Cluster -
6Snapmirror-WAN
7        -
8netapp9101
9        -
10netapp9101-01
11        -
12svm0    true
13svm2    false
14svm3    true
157 entries were displayed.
16 
17netapp9101::>

その2: AES session key enabled for NetLogon channel 設定

上記を設定しても、下記の様なエラーとなった。

1netapp9101::> vserver cifs create -vserver svm3 -cifs-server svm3 -domain vm2.adosakana.local
2 
3In order to create an Active Directory machine account for the CIFS server, you must supply the name and password of
4a Windows account with sufficient privileges to add computers to the "CN=Computers" container within the
5"ADOSAKANA.LOCAL" domain.
6 
7Enter the user name: administrator
8 
9Enter the password:
10 
11Error: Machine account creation procedure failed
12  [    43] Loaded the preliminary configuration.
13  [   133] Created a machine account in the domain
14  [   133] SID to name translations of Domain Users and Admins
15           completed successfully
16  [   134] Successfully connected to ip 172.17.44.49, port 88 using
17           TCP
18  [   144] Successfully connected to ip 172.17.44.49, port 464 using
19           TCP
20  [   226] Kerberos password set for 'SVM3$@ADOSAKANA.LOCAL' succeeded
21  [   226] Set initial account password
22  [   253] Successfully connected to ip 172.17.44.49, port 445 using
23           TCP
24  [   284] Successfully connected to ip 172.17.44.49, port 88 using
25           TCP
26  [   316] Successfully authenticated with DC
27           adserver.adosakana.local
28  [   323] Encountered NT error (NT_STATUS_PENDING) for SMB command
29           Read
30  [   327] Unable to connect to NetLogon service on
31           adserver.adosakana.local (Error:
32           RESULT_ERROR_GENERAL_FAILURE)
33**[   327] FAILURE: Unable to make a connection
34**         (NetLogon:ADOSAKANA.LOCAL), result: 3
35  [   327] Unable to make a NetLogon connection to
36           adserver.adosakana.local using the new machine account
37  [   344] Deleted existing account
38           'CN=SVM3,CN=Computers,DC=ADOSAKANA,DC=local'
39 
40Error: command failed: Failed to create the Active Directory machine account "SVM3". Reason: general failure.
41 
42netapp9101::>

この状況となった環境のActive Directoryサーバはsambaで作成しているため /usr/local/samba/var/log.samba を確認してみると下記のエラーがでていた。

1[2023/10/20 14:48:22.301935,  0] ../../source4/rpc_server/netlogon/dcerpc_netlogon.c:281(dcesrv_netr_ServerAuthenticate3_check_downgrade)
2  CVE-2022-38023: client_account[SVM3$] computer_name[SVM3] schannel_type[2] client_negotiate_flags[0x741ff] real_account[SVM3$] NT_STATUS_DOWNGRADE_DETECTED reject_des[0] reject_md5[1]
3[2023/10/20 14:48:22.302215,  0] ../../source4/rpc_server/netlogon/dcerpc_netlogon.c:291(dcesrv_netr_ServerAuthenticate3_check_downgrade)
4  CVE-2022-38023: Check if option 'server reject md5 schannel:SVM3$ = no' might be needed for a legacy client.
5[2023/10/20 14:48:22.304539,  0] ../../source4/rpc_server/netlogon/dcerpc_netlogon.c:281(dcesrv_netr_ServerAuthenticate3_check_downgrade)
6  CVE-2022-38023: client_account[SVM3$] computer_name[SVM3] schannel_type[2] client_negotiate_flags[0x701ff] real_account[SVM3$] NT_STATUS_DOWNGRADE_DETECTED reject_des[1] reject_md5[1]
7[2023/10/20 14:48:22.304600,  0] ../../source4/rpc_server/netlogon/dcerpc_netlogon.c:291(dcesrv_netr_ServerAuthenticate3_check_downgrade)
8  CVE-2022-38023: Check if option 'server reject md5 schannel:SVM3$ = no' might be needed for a legacy client.
9[2023/10/20 14:48:22.304638,  0] ../../source4/rpc_server/netlogon/dcerpc_netlogon.c:298(dcesrv_netr_ServerAuthenticate3_check_downgrade)
10  CVE-2022-38023: Check if option 'allow nt4 crypto:SVM3$ = yes' might be needed for a legacy client.

もしやkerneberosではなくNTLMで接続されてたりする?と lm-compatibility-level をkrb に設定しても同じ結果となった。

1netapp9101::> vserver cifs security modify -vserver svm3 -lm-compatibility-level krb
2 
3netapp9101::> vserver cifs security show -fields lm-compatibility-level
4vserver lm-compatibility-level
5------- ----------------------
6Cluster -
7Snapmirror-WAN -
8netapp9101 -
9netapp9101-01 -
10svm0    lm-ntlm-ntlmv2-krb
11svm2    lm-ntlm-ntlmv2-krb
12svm3    krb
137 entries were displayed.
14 
15netapp9101::>

さらに調べると「Configure Active Directory domain controller access overview」に、Netlogon にAESを使いたい場合は「aes-enabled-for-netlogon-channel」をtrueに設定する、と書いてあった

1netapp9101::> vserver cifs security show -fields aes-enabled-for-netlogon-channel
2vserver aes-enabled-for-netlogon-channel
3------- --------------------------------
4Cluster -
5Snapmirror-WAN -
6netapp9101 -
7netapp9101-01 -
8svm0    false
9svm2    false
10svm3    false
117 entries were displayed.
12 
13netapp9101::> vserver cifs security modify -vserver svm3 -aes-enabled-for-netlogon-channel true
14 
15netapp9101::> vserver cifs security show -fields aes-enabled-for-netlogon-channel
16vserver aes-enabled-for-netlogon-channel
17------- --------------------------------
18Cluster -
19Snapmirror-WAN -
20netapp9101 -
21netapp9101-01 -
22svm0    false
23svm2    false
24svm3    true
257 entries were displayed.
26 
27netapp9101::>

設定変更後に再実行したところ、Active Directory参加に成功した。

1netapp9101::> vserver cifs create -vserver svm3 -cifs-server svm3 -domain adosakana.local
2 
3In order to create an Active Directory machine account for the CIFS server, you must supply the name and password of
4a Windows account with sufficient privileges to add computers to the "CN=Computers" container within the
5"ADOSAKANA.LOCAL" domain.
6 
7Enter the user name: administrator
8 
9Enter the password:
10 
11Notice: SMB1 protocol version is obsolete and considered insecure. Therefore it is deprecated and disabled on this
12CIFS server. Support for SMB1 might be removed in a future release. If required, use the (privilege: advanced)
13"vserver cifs options modify -vserver svm3 -smb1-enabled true" to enable it.
14 
15netapp9101::>

↑のSMB1を有効にするかどうか、というところについては、複合機の出力先として指定されている、とか、LinuxサーバからCIFSでマウントしている、とか、Windowsワークグループからアクセスしている、という場合には有効にする、というような形となる。

Windows Server 2012R2に .Net Framework 3.5が追加できない場合の解決方法

実験するためWindows Server 2012R2を新規インストールして、まずはWindows Updateを全部適用してから、いろいろ設定していこう!と行ってみたところ思わぬところで問題が発生した。

結論を先に書いておくと「.NET Framework 3.5, 4.6.1, 4.7, 4.7.1, 4.7.2, 4.8 のセキュリティおよび品質ロールアップ」がインストールされていることが原因であるため

・Windows Updateを実施する前に追加すれば問題は発生しない
・Windows Update完了後に問題が発生した場合は「.NET Framework 3.5, 4.6.1, 4.7, 4.7.1, 4.7.2, 4.8 のセキュリティおよび品質ロールアップ」をアンインストールする

のどちらかを行うことで、インストールに成功するようになった。

ただ、.NET Frameworkのパッチの内部的な仕組みに気がつかないとアンインストールできないので、原因が知られていない、という状態でした。

問題の検証

Windows Updateが一通り終わったあとで、今回の実験対象のソフトウェアは.NET Framework 3.5が必要だな、と追加しようとしたらエラーとなった。

「代替ソースパスを指定」からDVD内のsources\sxs\を指定

で、エラー

このとき、イベントログのWindowsログの「Setup」に「パッケージ Microsoft .NET Framework 3.0の更新 NetFx3 を有効にできませんでした。 状態 0x800f0906。」と出ている

「0x800f0906」で調べると「.NET Framework 3.5 の展開エラーと解決手順」が出てくるが、コレではなかった。

[MS14-046] Windows 8.1 および Windows Server 2012 R2 用の .NET Framework 3.5 のセキュリティ更新プログラムについて (2014 年 8 月 12 日)」に以下の記載がある

Microsoft .NET Framework 3.5 用のセキュリティ更新プログラム 2966828 (マイクロソフト セキュリティ情報 MS14-046 に記載されています) をインストールした後、[Windows の機能] で Microsoft .NET Framework 3.5 のオプションの機能を初めて有効にしようとしたときに、機能がインストールされないことがあります。Microsoft .NET Framework 3.5 の機能を追加する前にインストールを “段階的に実行” した場合にこのエラーが発生することがあります。
この問題を解決するには、更新プログラム 3005628 をインストールします。
この問題を回避する方法の詳細については、以下のサポート技術情報番号をクリックしてください。
3002547Windows 8、Windows Server 2012、Windows 8.1、または Windows Server 2012 R2 でセキュリティ更新プログラム 2966827 または 2966828 をインストールした後に Microsoft .NET Framework 3.5 のオプションの Windows 機能を有効化できないことがある

更新プログラム 3005628「Windows 8、Windows 8.1、Windows Server 2012、および Windows Server 2012 R2 上の .NET Framework 3.5 の更新プログラム」の説明を読むと、原因としては、.NET Framework 3.5がインストールされていないのに、.NET Framework 3.5に関する更新プログラムがインストールされていることが原因である模様。

しかし、2023年9月現在では更新プログラム3005628 を適用してみたが効力はなかった。

更新履歴をみると「.NET Framework 3.5, 4.6.1, 4.7, 4.7.1, 4.7.2, 4.8 のセキュリティおよび品質ロールアップ」がある。

しかし、インストールされた更新プログラムを確認すると、.NET Framework関連のパッチがないのでインストールできないように見える。

ただ、調べたところwusaコマンドを使うとアンインストールできそうな感じだったので「wusa /uninstall /kb:5030184」でアンインストールを試みたが「インストールされていない」と表示される。

2023 年 9 月 12 日 – Windows Server 2012 R2 用 .NET Framework 3.5、4.6.2、4.7、4.7.1、4.7.2、4.8 のセキュリティおよび品質ロールアップ (KB5030184)」を確認すると、実はこの更新プログラム「Windows Server 2012 R2 用 .NET Framework 3.5 のセキュリティおよび品質ロールアップについて (KB5029915)」「Windows Server 2012 R2 用 .NET Framework 4.6.2、4.7、4.7.1、4.7.2 のセキュリティおよび品質ロールアップについて (KB5029916)」「Windows Server 2012 R2 用 .NET Framework 4.8 のセキュリティおよび品質ロールアップについて (KB5029917)」の3本だてらしい。

更新履歴上にこの3つは載ってないけど、試してみるかと「wusa /uninstall /kb:5029915」を実行すると、アンインストールに成功した。

おや?と思って、先ほどのインストールされた更新プログラム画像を再確認するとKB5029915がいた・・・

なるほど・・・「更新履歴」と「インストールされた更新プログラム」とで表示されるKB番号が別なのか・・・

で・・・これで大丈夫かな?と、.Net 3.5追加を試してみたらエラーになった。

もう一度更新一覧を確認しなおすともう1つ「.NET Framework 3.5, 4.6.1, 4.7, 4.7.1, 4.7.2, 4.8 のセキュリティおよび品質ロールアップ」があった

そちらは「2023 年 8 月 8 日 – Windows Server 2012 R2 用 .NET Framework 3.5、4.6.2、4.7、4.7.1、4.7.2、4.8 のセキュリティおよび品質ロールアップ (KB5029653)」で、「Windows Server 2012 R2 用 .NET Framework 3.5 のセキュリティおよび品質ロールアップについて (KB5028970)」「Windows Server 2012 R2 用 .NET Framework 4.6.2、4.7、4.7.1、4.7.2 のセキュリティおよび品質ロールアップについて (KB5028962)」「Windows Server 2012 R2 用 .NET Framework 4.8 のセキュリティおよび品質ロールアップについて (KB5028957)」なので、「wusa /uninstall /kb:5028970」でアンインストールを実行。

もしくは「インストールされた更新プログラム」から「Microsoft Windows (KB5028970)の更新プログラム」を右クリックして「アンインストール」でも大丈夫です。

役割と機能の追加から「.NET Framework 3.5」を実施してみたところ、今度は成功した。

この状態で新しくインストールされる更新プログラムを確認したところ、.NET 3.5専用のものの他に、先ほど.NET 3.5用のみアンインストールしたKB5030184もインストールされること、ということが確認出来た。

で、実際に適用したあとに、履歴一覧を確認するとKB5030184 が2回適用されていることが確認できた。

Windows Updateしたらsamba ADへの接続がおかしくなった

sambaで作ったsamba AD環境がある。

最近、新しい仮想マシン作ってドメイン参加したあと、PowerShellで「Test-ComputerSecureChannel」を実行したら「False」と出た。

repairしても状況が変わらない

(ADサーバと該当マシン間の通信がセキュアチャネルを使って行われていないという状態)

いまつかっているsambaバージョンを確認すると4.18.2

1# /usr/local/samba/sbin/smbd --version
2Version 4.18.2
3#

sambaのリリース履歴を見るとNetAppでも問題になったセキュリティ修正関連での修正が出ている。

CVE-2023-34967CVE-2022-2127CVE-2023-34968CVE-2023-34966 and CVE-2023-3347.

直接のバグとしては「Bug 15418 – secure channel faulty since Windows 10/11 update 07/2023」が該当している模様

バグであるならアップデートするしかないな、というわけで、samba 4.18.5へアップデート

展開して、make;make install; systemctl restart samba-ad-dc っと

1# /usr/local/samba/sbin/smbd --version
2Version 4.18.5
3#

で、repairすると、今度は成功しました

Windows11インストール時に時刻と通貨の形式設定をいじっておくと余計なアプリがインストールされない件

twitterで「Windows 11を「英語(世界)」でインストールすると余計なアプリがインストールされないんだぜ(意訳)」というのが回ってきたので検証してみた。

とりあえずvSphere環境でインストールを実施

時刻と通過の形式を「英語(世界)」に選択するけど、インストールする言語とキーボードまたは入力方式は「日本語」とする設定でWindows 11のインストールを実施

インストール完了して確認!

確かに余計なアプリがインストールされていません。

なぜかなぁ・・・と思いつつMicrosoft Storeを起動してみると原因判明

「英語(世界)」ではMicrosoft Storeが利用できないため、Microsoft Store経由でインストールされる余計なアプリのインストールができない、という状態でした。

設定を戻してみる

インストール時に変更した設定を戻した場合にどうなるかを確認するため、[時刻と言語]の[言語と地域]にある設定を変更

最初は「国または地域:すべて」「地域設定:英語(世界)」でした。

通常の日本語として設定する場合は「国または地域:日本」「地域設定:日本語(日本)」となります。

最初は地域設定のみを変えてみたのですが、その場合はタスクバーに表示される日付表示などは変更されましたが、Microsoft Storeの動作は変更されませんでした。

設定変更後、再起動することでMicrosoft Storeも使用できるようになりました。

今回インストールしたWindows 11 22H2だと約49個のアプリがMicrosoft Store経由のアップデート対象となっていたようです。

ストア系アプリのアップデートが全て完了した状態で確認してみます。

特にアプリは追加されていないようですね。

ということで、インストール時の変更で余計なアプリをインストールさせない、という手法でした。

ただ・・・たぶん、Microsoftアカウントと連携してしまうと、そちら経由でアプリが追加されたりするんじゃないかなぁ・・・とかは感じます

Ryzen 5 5600G環境とRyzen 7 5800H環境でStable Diffusionを使うメモ

nVidia GPUやAMD GPUを使ってStable Diffusion をやるって話はあるけど、AMD Ryzen GPU付きのGPU部分を使ってできるのか、ってのがよく分からなかったので試してみた。

1) 前準備

Windows 11環境なのでwingetコマンドを使ってpythonとgitをインストール

1> winget install Python.Python.3.10
2> winget install Git.Git

ただ、python 3.10.11 がインストールされたんだが、オリジナルの Stable Diffusion web UI の「Automatic Installation on Windows」には「Install Python 3.10.6 (Newer version of Python does not support torch), checking “Add Python to PATH”.」という記載が・・・果たしてホントにダメなのか?→問題ありませんでした

2) SD.Next編…失敗

いろいろ自働でセットアップしてくれるStable Diffusion web UI とそれにいろいろ機能を付け加えている SD.Next などがある。

とりあえず試してみるか、とやってみたが、CPUでの動作となっていた。(ドキュメントにWindowsでのAMDは対応していない、とある通り)

2023/09/14追記: 現在はSD.NextもDirectML対応になり使える様になりました
2023/11/24追記: SD.NextをDirectML使ってRyzen 5600Gで動かすと結構頻繁に処理途中で止まる感じでイマイチです。たぶんGPUメモリ少ないとイマイチなんでしょう。

1PS D:\> mkdir sdnext
2    ディレクトリ: D:\
3Mode                 LastWriteTime         Length Name
4----                 -------------         ------ ----
5d-----        2023/07/11     15:23                sdnext
6PS D:\> cd sdnext
7PS D:\sdnext> git clone https://github.com/vladmandic/automatic
8Cloning into 'automatic'...
9remote: Enumerating objects: 27653, done.
10remote: Counting objects: 100% (446/446), done.
11remote: Compressing objects: 100% (206/206), done.
12remote: Total 27653 (delta 300), reused 343 (delta 238), pack-reused 27207
13Receiving objects: 100% (27653/27653), 34.77 MiB | 9.98 MiB/s, done.
14Resolving deltas: 100% (19681/19681), done.
15PS D:\sdnext> dir
16    ディレクトリ: D:\sdnext
17Mode                 LastWriteTime         Length Name
18----                 -------------         ------ ----
19d-----        2023/07/11     15:23                automatic
20PS D:\sdnext> cd .\automatic\
21PS D:\sdnext\automatic> dir
22    ディレクトリ: D:\sdnext\automatic
23Mode                 LastWriteTime         Length Name
24----                 -------------         ------ ----
25d-----        2023/07/11     15:23                .github
26d-----        2023/07/11     15:23                .vscode
27d-----        2023/07/11     15:23                cli
28d-----        2023/07/11     15:23                configs
29d-----        2023/07/11     15:23                extensions
30d-----        2023/07/11     15:23                extensions-builtin
31d-----        2023/07/11     15:23                html
32d-----        2023/07/11     15:23                javascript
33d-----        2023/07/11     15:23                models
34d-----        2023/07/11     15:23                modules
35d-----        2023/07/11     15:23                repositories
36d-----        2023/07/11     15:23                scripts
37d-----        2023/07/11     15:23                train
38d-----        2023/07/11     15:23                wiki
39-a----        2023/07/11     15:23             53 .eslintignore
40-a----        2023/07/11     15:23           3184 .eslintrc.json
41-a----        2023/07/11     15:23            800 .gitignore
42-a----        2023/07/11     15:23           2135 .gitmodules
43-a----        2023/07/11     15:23             98 .markdownlint.json
44-a----        2023/07/11     15:23           5949 .pylintrc
45-a----        2023/07/11     15:23          26192 CHANGELOG.md
46-a----        2023/07/11     15:23          37405 installer.py
47-a----        2023/07/11     15:23           7610 launch.py
48-a----        2023/07/11     15:23          35240 LICENSE.txt
49-a----        2023/07/11     15:23           1255 pyproject.toml
50-a----        2023/07/11     15:23           7897 README.md
51-a----        2023/07/11     15:23            832 requirements.txt
52-a----        2023/07/11     15:23           1254 SECURITY.md
53-a----        2023/07/11     15:23           2153 TODO.md
54-a----        2023/07/11     15:23           2135 webui.bat
55-a----        2023/07/11     15:23          13616 webui.py
56-a----        2023/07/11     15:23           2515 webui.sh
57PS D:\sdnext\automatic>
1PS D:\sdnext\automatic> .\webui.bat
2Creating venv in directory D:\sdnext\automatic\venv using python "C:\Users\OSAKANATARO\AppData\Local\Programs\Python\Python310\python.exe"
3Using VENV: D:\sdnext\automatic\venv
415:25:01-666542 INFO     Starting SD.Next
515:25:01-669541 INFO     Python 3.10.11 on Windows
615:25:01-721480 INFO     Version: 6466d3cb Mon Jul 10 17:20:29 2023 -0400
715:25:01-789179 INFO     Using CPU-only Torch
815:25:01-791196 INFO     Installing package: torch torchvision
915:28:27-814772 INFO     Torch 2.0.1+cpu
1015:28:27-816772 INFO     Installing package: tensorflow==2.12.0
1115:29:30-011443 INFO     Verifying requirements
1215:29:30-018087 INFO     Installing package: addict
1315:29:31-123764 INFO     Installing package: aenum
1415:29:32-305603 INFO     Installing package: aiohttp
1515:29:34-971224 INFO     Installing package: anyio
1615:29:36-493994 INFO     Installing package: appdirs
1715:29:37-534966 INFO     Installing package: astunparse
1815:29:38-564191 INFO     Installing package: bitsandbytes
1915:29:50-921879 INFO     Installing package: blendmodes
2015:29:53-458099 INFO     Installing package: clean-fid
2115:30:03-300722 INFO     Installing package: easydev
2215:30:06-960355 INFO     Installing package: extcolors
2315:30:08-507545 INFO     Installing package: facexlib
2415:30:33-800356 INFO     Installing package: filetype
2515:30:35-194993 INFO     Installing package: future
2615:30:42-170599 INFO     Installing package: gdown
2715:30:43-999361 INFO     Installing package: gfpgan
2815:31:07-467514 INFO     Installing package: GitPython
2915:31:09-671195 INFO     Installing package: httpcore
3015:31:11-496157 INFO     Installing package: inflection
3115:31:12-879955 INFO     Installing package: jsonmerge
3215:31:16-636081 INFO     Installing package: kornia
3315:31:20-478210 INFO     Installing package: lark
3415:31:22-125443 INFO     Installing package: lmdb
3515:31:23-437953 INFO     Installing package: lpips
3615:31:24-867851 INFO     Installing package: omegaconf
3715:31:29-258237 INFO     Installing package: open-clip-torch
3815:31:36-741714 INFO     Installing package: opencv-contrib-python
3915:31:43-728945 INFO     Installing package: piexif
4015:31:45-357791 INFO     Installing package: psutil
4115:31:47-282924 INFO     Installing package: pyyaml
4215:31:48-716454 INFO     Installing package: realesrgan
4315:31:50-511931 INFO     Installing package: resize-right
4415:31:52-093682 INFO     Installing package: rich
4515:31:53-644532 INFO     Installing package: safetensors
4615:31:55-125015 INFO     Installing package: scipy
4715:31:56-653853 INFO     Installing package: tb_nightly
4815:31:58-439541 INFO     Installing package: toml
4915:32:00-133340 INFO     Installing package: torchdiffeq
5015:32:01-912273 INFO     Installing package: torchsde
5115:32:04-240460 INFO     Installing package: voluptuous
5215:32:05-884949 INFO     Installing package: yapf
5315:32:07-385998 INFO     Installing package: scikit-image
5415:32:08-929379 INFO     Installing package: basicsr
5515:32:10-544987 INFO     Installing package: compel
5615:32:41-171247 INFO     Installing package: typing-extensions==4.7.1
5715:32:43-013058 INFO     Installing package: antlr4-python3-runtime==4.9.3
5815:32:45-010443 INFO     Installing package: pydantic==1.10.11
5915:32:47-661255 INFO     Installing package: requests==2.31.0
6015:32:49-665092 INFO     Installing package: tqdm==4.65.0
6115:32:51-622194 INFO     Installing package: accelerate==0.20.3
6215:32:54-560549 INFO     Installing package: opencv-python==4.7.0.72
6315:33:01-124008 INFO     Installing package: diffusers==0.18.1
6415:33:03-084405 INFO     Installing package: einops==0.4.1
6515:33:05-232281 INFO     Installing package: gradio==3.32.0
6615:33:31-795569 INFO     Installing package: numexpr==2.8.4
6715:33:34-212078 INFO     Installing package: numpy==1.23.5
6815:33:36-321166 INFO     Installing package: numba==0.57.0
6915:33:45-795266 INFO     Installing package: pandas==1.5.3
7015:34:02-667504 INFO     Installing package: protobuf==3.20.3
7115:34:04-879519 INFO     Installing package: pytorch_lightning==1.9.4
7215:34:11-965173 INFO     Installing package: transformers==4.30.2
7315:34:14-260230 INFO     Installing package: tomesd==0.1.3
7415:34:16-574323 INFO     Installing package: urllib3==1.26.15
7515:34:19-258844 INFO     Installing package: Pillow==9.5.0
7615:34:21-521566 INFO     Installing package: timm==0.6.13
7715:34:25-728405 INFO     Verifying packages
7815:34:25-729402 INFO     Installing package: git+https://github.com/openai/CLIP.git
7915:34:32-108450 INFO     Installing package:
8115:34:40-136600 INFO     Installing package: onnxruntime==1.15.1
8215:34:45-579550 INFO     Verifying repositories
8315:34:45-581057 INFO     Cloning repository: https://github.com/Stability-AI/stablediffusion.git
8415:34:54-267186 INFO     Cloning repository: https://github.com/CompVis/taming-transformers.git
8515:35:39-098788 INFO     Cloning repository: https://github.com/crowsonkb/k-diffusion.git
8615:35:40-207126 INFO     Cloning repository: https://github.com/sczhou/CodeFormer.git
8715:35:43-303813 INFO     Cloning repository: https://github.com/salesforce/BLIP.git
8815:35:45-355666 INFO     Verifying submodules
8915:36:50-587204 INFO     Extension installed packages: clip-interrogator-ext ['clip-interrogator==0.6.0']
9015:36:57-547973 INFO     Extension installed packages: sd-webui-agent-scheduler ['SQLAlchemy==2.0.18',
91                         'greenlet==2.0.2']
9215:37:26-237541 INFO     Extension installed packages: sd-webui-controlnet ['pywin32==306', 'lxml==4.9.3',
93                         'reportlab==4.0.4', 'pycparser==2.21', 'portalocker==2.7.0', 'cffi==1.15.1', 'svglib==1.5.1',
94                         'tinycss2==1.2.1', 'mediapipe==0.10.2', 'tabulate==0.9.0', 'cssselect2==0.7.0',
95                         'webencodings==0.5.1', 'sounddevice==0.4.6', 'iopath==0.1.9', 'yacs==0.1.8',
96                         'fvcore==0.1.5.post20221221']
9715:37:41-631094 INFO     Extension installed packages: stable-diffusion-webui-images-browser ['Send2Trash==1.8.2',
98                         'image-reward==1.5', 'fairscale==0.4.13']
9915:37:48-683136 INFO     Extension installed packages: stable-diffusion-webui-rembg ['rembg==2.0.38', 'pooch==1.7.0',
100                         'PyMatting==1.1.8']
10115:37:48-781391 INFO     Extensions enabled: ['a1111-sd-webui-lycoris', 'clip-interrogator-ext', 'LDSR', 'Lora',
102                         'multidiffusion-upscaler-for-automatic1111', 'ScuNET', 'sd-dynamic-thresholding',
103                         'sd-extension-system-info', 'sd-webui-agent-scheduler', 'sd-webui-controlnet',
104                         'stable-diffusion-webui-images-browser', 'stable-diffusion-webui-rembg', 'SwinIR']
10515:37:48-783895 INFO     Verifying packages
10615:37:48-845754 INFO     Extension preload: 0.0s D:\sdnext\automatic\extensions-builtin
10715:37:48-846767 INFO     Extension preload: 0.0s D:\sdnext\automatic\extensions
10815:37:48-882113 INFO     Server arguments: []
10915:37:56-683469 INFO     Pipeline: Backend.ORIGINAL
110No module 'xformers'. Proceeding without it.
11115:38:01-166704 INFO     Libraries loaded
11215:38:01-168718 INFO     Using data path: D:\sdnext\automatic
11315:38:01-171245 INFO     Available VAEs: D:\sdnext\automatic\models\VAE 0
11415:38:01-174758 INFO     Available models: D:\sdnext\automatic\models\Stable-diffusion 0
115Download the default model? (y/N) y
116Downloading: "https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors" to D:\sdnext\automatic\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors
117100.0%
11815:45:08-083310 INFO     ControlNet v1.1.232
119ControlNet v1.1.232
120ControlNet preprocessor location: D:\sdnext\automatic\extensions-builtin\sd-webui-controlnet\annotator\downloads
12115:45:08-271984 INFO     ControlNet v1.1.232
122ControlNet v1.1.232
123Image Browser: ImageReward is not installed, cannot be used.
124Image Browser: Creating database
125Image Browser: Database created
12615:45:08-497758 ERROR    Module load:
127                         D:\sdnext\automatic\extensions-builtin\stable-diffusion-webui-rembg\scripts\api.py: ImportError
128Module load: D:\sdnext\automatic\extensions-builtin\stable-diffusion-webui-rembg\scripts\api.py: ImportError
129╭───────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────╮
130│ D:\sdnext\automatic\modules\script_loading.py:13 in load_module                                                      │
131│                                                                                                                      │
132│   12 │   try:                                                                                                        │
133│ ❱ 13 │   │   module_spec.loader.exec_module(module)                                                                  │
134│   14 │   except Exception as e:                                                                                      │
135│ in exec_module:883                                                                                                   │
136│                                                                                                                      │
137│                                               ... 7 frames hidden ...                                                │
138│                                                                                                                      │
139│ D:\sdnext\automatic\venv\lib\site-packages\numba\__init__.py:55 in <module>                                          │
140│                                                                                                                      │
141│    54                                                                                                                │
142│ ❱  55 _ensure_critical_deps()                                                                                        │
143│    56 # END DO NOT MOVE                                                                                              │
144│                                                                                                                      │
145│ D:\sdnext\automatic\venv\lib\site-packages\numba\__init__.py:42 in _ensure_critical_deps                             │
146│                                                                                                                      │
147│    41 │   elif numpy_version > (1, 24):                                                                              │
148│ ❱  42 │   │   raise ImportError("Numba needs NumPy 1.24 or less")                                                    │
149│    43 │   try:                                                                                                       │
150╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
151ImportError: Numba needs NumPy 1.24 or less
15215:45:08-546905 ERROR    Module load:
153                         D:\sdnext\automatic\extensions-builtin\stable-diffusion-webui-rembg\scripts\postprocessing_remb
154                         g.py: ImportError
155Module load: D:\sdnext\automatic\extensions-builtin\stable-diffusion-webui-rembg\scripts\postprocessing_rembg.py: ImportError
156╭───────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────╮
157│ D:\sdnext\automatic\modules\script_loading.py:13 in load_module                                                      │
158│                                                                                                                      │
159│   12 │   try:                                                                                                        │
160│ ❱ 13 │   │   module_spec.loader.exec_module(module)                                                                  │
161│   14 │   except Exception as e:                                                                                      │
162│ in exec_module:883                                                                                                   │
163│                                                                                                                      │
164│                                               ... 7 frames hidden ...                                                │
165│                                                                                                                      │
166│ D:\sdnext\automatic\venv\lib\site-packages\numba\__init__.py:55 in <module>                                          │
167│                                                                                                                      │
168│    54                                                                                                                │
169│ ❱  55 _ensure_critical_deps()                                                                                        │
170│    56 # END DO NOT MOVE                                                                                              │
171│                                                                                                                      │
172│ D:\sdnext\automatic\venv\lib\site-packages\numba\__init__.py:42 in _ensure_critical_deps                             │
173│                                                                                                                      │
174│    41 │   elif numpy_version > (1, 24):                                                                              │
175│ ❱  42 │   │   raise ImportError("Numba needs NumPy 1.24 or less")                                                    │
176│    43 │   try:                                                                                                       │
177╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
178ImportError: Numba needs NumPy 1.24 or less
17915:45:08-867572 INFO     Loading UI theme: name=black-orange style=Auto
180Running on local URL:  http://127.0.0.1:7860
18115:45:11-480274 INFO     Local URL: http://127.0.0.1:7860/
18215:45:11-482798 INFO     Initializing middleware
18315:45:11-602837 INFO     [AgentScheduler] Task queue is empty
18415:45:11-606823 INFO     [AgentScheduler] Registering APIs
18515:45:11-709704 INFO     Model metadata saved: D:\sdnext\automatic\metadata.json 1
186Loading weights: D:\sdnext\automatic\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors ━━━━━━━━━ 0.0/4.3   -:--:--
187                                                                                                       GB
18815:45:12-501405 WARNING  Torch FP16 test failed: Forcing FP32 operations: "LayerNormKernelImpl" not implemented for
189                         'Half'
19015:45:12-503413 INFO     Torch override dtype: no-half set
19115:45:12-504408 INFO     Torch override VAE dtype: no-half set
19215:45:12-505409 INFO     Setting Torch parameters: dtype=torch.float32 vae=torch.float32 unet=torch.float32
193LatentDiffusion: Running in eps-prediction mode
194DiffusionWrapper has 859.52 M params.
195Downloading (…)olve/main/vocab.json: 100%|██████████████████████████████████████████| 961k/961k [00:00<00:00, 1.61MB/s]
196Downloading (…)olve/main/merges.txt: 100%|██████████████████████████████████████████| 525k/525k [00:00<00:00, 1.16MB/s]
197Downloading (…)cial_tokens_map.json: 100%|████████████████████████████████████████████████████| 389/389 [00:00<?, ?B/s]
198Downloading (…)okenizer_config.json: 100%|████████████████████████████████████████████████████| 905/905 [00:00<?, ?B/s]
199Downloading (…)lve/main/config.json: 100%|████████████████████████████████████████████████| 4.52k/4.52k [00:00<?, ?B/s]
200Calculating model hash: D:\sdnext\automatic\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors ━━━━━━ 4.3/4… 0:00:…
201                                                                                                           GB
20215:45:20-045323 INFO     Applying Doggettx cross attention optimization
20315:45:20-051844 INFO     Embeddings: loaded=0 skipped=0
20415:45:20-057917 INFO     Model loaded in 8.1s (load=0.2s config=0.4s create=3.5s hash=3.2s apply=0.8s)
20515:45:20-301777 INFO     Model load finished: {'ram': {'used': 8.55, 'total': 31.3}} cached=0
20615:45:20-859838 INFO     Startup time: 452.0s (torch=4.3s gradio=2.4s libraries=5.5s models=424.0s codeformer=0.2s
207                         scripts=3.3s onchange=0.2s ui-txt2img=0.1s ui-img2img=0.1s ui-settings=0.4s ui-extensions=1.7s
208                         ui-defaults=0.1s launch=0.2s app-started=0.2s checkpoint=9.2s)

エラーがでていたので中断して、もう1回起動してみたらさっき出てたエラーっぽいのはないが止まった。

1PS D:\sdnext\automatic> .\webui.bat
2Using VENV: D:\sdnext\automatic\venv
320:46:25-099403 INFO     Starting SD.Next
420:46:25-107728 INFO     Python 3.10.11 on Windows
520:46:25-168108 INFO     Version: 6466d3cb Mon Jul 10 17:20:29 2023 -0400
620:46:25-610382 INFO     Latest published version: a844a83d9daa9987295932c0db391ec7be5f2d32 2023-07-11T08:00:45Z
720:46:25-634606 INFO     Using CPU-only Torch
820:46:28-219427 INFO     Torch 2.0.1+cpu
920:46:28-220614 INFO     Installing package: tensorflow==2.12.0
1020:47:05-861641 INFO     Enabled extensions-builtin: ['a1111-sd-webui-lycoris', 'clip-interrogator-ext', 'LDSR', 'Lora',
11                         'multidiffusion-upscaler-for-automatic1111', 'ScuNET', 'sd-dynamic-thresholding',
12                         'sd-extension-system-info', 'sd-webui-agent-scheduler', 'sd-webui-controlnet',
13                         'stable-diffusion-webui-images-browser', 'stable-diffusion-webui-rembg', 'SwinIR']
1420:47:05-870117 INFO     Enabled extensions: []
1520:47:05-872302 INFO     Verifying requirements
1620:47:05-889503 INFO     Verifying packages
1720:47:05-891503 INFO     Verifying repositories
1820:47:11-387347 INFO     Verifying submodules
1920:47:32-176175 INFO     Extensions enabled: ['a1111-sd-webui-lycoris', 'clip-interrogator-ext', 'LDSR', 'Lora',
20                         'multidiffusion-upscaler-for-automatic1111', 'ScuNET', 'sd-dynamic-thresholding',
21                         'sd-extension-system-info', 'sd-webui-agent-scheduler', 'sd-webui-controlnet',
22                         'stable-diffusion-webui-images-browser', 'stable-diffusion-webui-rembg', 'SwinIR']
2320:47:32-178176 INFO     Verifying packages
2420:47:32-186325 INFO     Extension preload: 0.0s D:\sdnext\automatic\extensions-builtin
2520:47:32-188648 INFO     Extension preload: 0.0s D:\sdnext\automatic\extensions
2620:47:32-221762 INFO     Server arguments: []
2720:47:40-417209 INFO     Pipeline: Backend.ORIGINAL
28No module 'xformers'. Proceeding without it.
2920:47:43-468816 INFO     Libraries loaded
3020:47:43-469815 INFO     Using data path: D:\sdnext\automatic
3120:47:43-473321 INFO     Available VAEs: D:\sdnext\automatic\models\VAE 0
3220:47:43-488860 INFO     Available models: D:\sdnext\automatic\models\Stable-diffusion 1
3320:47:46-821663 INFO     ControlNet v1.1.232
34ControlNet v1.1.232
35ControlNet preprocessor location: D:\sdnext\automatic\extensions-builtin\sd-webui-controlnet\annotator\downloads
3620:47:47-027110 INFO     ControlNet v1.1.232
37ControlNet v1.1.232
38Image Browser: ImageReward is not installed, cannot be used.
3920:48:25-145779 INFO     Loading UI theme: name=black-orange style=Auto
40Running on local URL:  http://127.0.0.1:7860
4120:48:27-450550 INFO     Local URL: http://127.0.0.1:7860/
4220:48:27-451639 INFO     Initializing middleware
4320:48:28-016312 INFO     [AgentScheduler] Task queue is empty
4420:48:28-017325 INFO     [AgentScheduler] Registering APIs
4520:48:28-133032 WARNING  Selected checkpoint not found: model.ckpt
46Loading weights: D:\sdnext\automatic\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors ━━━━━━━━━ 0.0/4.3   -:--:--
47                                                                                                       GB
4820:48:29-090045 WARNING  Torch FP16 test failed: Forcing FP32 operations: "LayerNormKernelImpl" not implemented for
49                         'Half'
5020:48:29-091161 INFO     Torch override dtype: no-half set
5120:48:29-092186 INFO     Torch override VAE dtype: no-half set
5220:48:29-093785 INFO     Setting Torch parameters: dtype=torch.float32 vae=torch.float32 unet=torch.float32
53LatentDiffusion: Running in eps-prediction mode
54DiffusionWrapper has 859.52 M params.
5520:48:30-662359 INFO     Applying Doggettx cross attention optimization
5620:48:30-666359 INFO     Embeddings: loaded=0 skipped=0
5720:48:30-679671 INFO     Model loaded in 2.2s (load=0.2s config=0.4s create=0.5s apply=1.0s)
5820:48:31-105108 INFO     Model load finished: {'ram': {'used': 8.9, 'total': 31.3}} cached=0
5920:48:31-879698 INFO     Startup time: 59.7s (torch=6.1s gradio=1.5s libraries=3.7s codeformer=0.1s scripts=41.4s
60                         onchange=0.2s ui-txt2img=0.1s ui-img2img=0.1s ui-settings=0.1s ui-extensions=1.6s
61                         ui-defaults=0.1s launch=0.2s app-started=0.7s checkpoint=3.7s)

起動メッセージを確認すると「Using CPU-only Torch」と出ている

3) DirectML版

素直にAMDへの対応手法が記載されているオリジナルのStable Diffusion web UI を使うことにして「Install and Run on AMD GPUs」の「Windows」にある手順を実行します。

2Cloning into 'stable-diffusion-webui-directml'...
3remote: Enumerating objects: 23452, done.
4remote: Counting objects: 100% (12/12), done.
5remote: Compressing objects: 100% (11/11), done.
6remote: Total 23452 (delta 3), reused 6 (delta 1), pack-reused 23440
7Receiving objects: 100% (23452/23452), 31.11 MiB | 8.63 MiB/s, done.
8Resolving deltas: 100% (16326/16326), done.
9PS D:\sdnext> cd .\stable-diffusion-webui-directml\
10PS D:\sdnext\stable-diffusion-webui-directml> git submodule init
11PS D:\sdnext\stable-diffusion-webui-directml> git submodule update
12PS D:\sdnext\stable-diffusion-webui-directml>

そして実行

1PS D:\sdnext\stable-diffusion-webui-directml> .\webui-user.bat
2Creating venv in directory D:\sdnext\stable-diffusion-webui-directml\venv using python "C:\Users\OSAKANATARO\AppData\Local\Programs\Python\Python310\python.exe"
3venv "D:\sdnext\stable-diffusion-webui-directml\venv\Scripts\Python.exe"
4fatal: No names found, cannot describe anything.
5Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
6Version: ## 1.4.0
7Commit hash: 265d626471eacd617321bdb51e50e4b87a7ca82e
8Installing torch and torchvision
9Collecting torch==2.0.0
10  Downloading torch-2.0.0-cp310-cp310-win_amd64.whl (172.3 MB)
11     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 172.3/172.3 MB 7.9 MB/s eta 0:00:00
12Collecting torchvision==0.15.1
13  Downloading torchvision-0.15.1-cp310-cp310-win_amd64.whl (1.2 MB)
14     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 10.8 MB/s eta 0:00:00
15Collecting torch-directml
16  Downloading torch_directml-0.2.0.dev230426-cp310-cp310-win_amd64.whl (8.2 MB)
17     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 8.2/8.2 MB 8.6 MB/s eta 0:00:00
18Collecting filelock
19  Using cached filelock-3.12.2-py3-none-any.whl (10 kB)
20Collecting sympy
21  Using cached sympy-1.12-py3-none-any.whl (5.7 MB)
22Collecting typing-extensions
23  Using cached typing_extensions-4.7.1-py3-none-any.whl (33 kB)
24Collecting jinja2
25  Using cached Jinja2-3.1.2-py3-none-any.whl (133 kB)
26Collecting networkx
27  Using cached networkx-3.1-py3-none-any.whl (2.1 MB)
28Collecting numpy
29  Using cached numpy-1.25.1-cp310-cp310-win_amd64.whl (15.0 MB)
30Collecting requests
31  Using cached requests-2.31.0-py3-none-any.whl (62 kB)
32Collecting pillow!=8.3.*,>=5.3.0
33  Using cached Pillow-10.0.0-cp310-cp310-win_amd64.whl (2.5 MB)
34Collecting MarkupSafe>=2.0
35  Using cached MarkupSafe-2.1.3-cp310-cp310-win_amd64.whl (17 kB)
36Collecting certifi>=2017.4.17
37  Using cached certifi-2023.5.7-py3-none-any.whl (156 kB)
38Collecting charset-normalizer<4,>=2
39  Using cached charset_normalizer-3.2.0-cp310-cp310-win_amd64.whl (96 kB)
40Collecting idna<4,>=2.5
41  Using cached idna-3.4-py3-none-any.whl (61 kB)
42Collecting urllib3<3,>=1.21.1
43  Using cached urllib3-2.0.3-py3-none-any.whl (123 kB)
44Collecting mpmath>=0.19
45  Using cached mpmath-1.3.0-py3-none-any.whl (536 kB)
46Installing collected packages: mpmath, urllib3, typing-extensions, sympy, pillow, numpy, networkx, MarkupSafe, idna, filelock, charset-normalizer, certifi, requests, jinja2, torch, torchvision, torch-directml
47Successfully installed MarkupSafe-2.1.3 certifi-2023.5.7 charset-normalizer-3.2.0 filelock-3.12.2 idna-3.4 jinja2-3.1.2 mpmath-1.3.0 networkx-3.1 numpy-1.25.1 pillow-10.0.0 requests-2.31.0 sympy-1.12 torch-2.0.0 torch-directml-0.2.0.dev230426 torchvision-0.15.1 typing-extensions-4.7.1 urllib3-2.0.3
48[notice] A new release of pip is available: 23.0.1 -> 23.1.2
49[notice] To update, run: D:\sdnext\stable-diffusion-webui-directml\venv\Scripts\python.exe -m pip install --upgrade pip
50Installing gfpgan
51Installing clip
52Installing open_clip
53Cloning Stable Diffusion into D:\sdnext\stable-diffusion-webui-directml\repositories\stable-diffusion-stability-ai...
54Cloning K-diffusion into D:\sdnext\stable-diffusion-webui-directml\repositories\k-diffusion...
55Cloning CodeFormer into D:\sdnext\stable-diffusion-webui-directml\repositories\CodeFormer...
56Cloning BLIP into D:\sdnext\stable-diffusion-webui-directml\repositories\BLIP...
57Installing requirements for CodeFormer
58Installing requirements
59Launching Web UI with arguments:
60No module 'xformers'. Proceeding without it.
61Warning: caught exception 'Torch not compiled with CUDA enabled', memory monitor disabled
62Downloading: "https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors" to D:\sdnext\stable-diffusion-webui-directml\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors
63100%|█████████████████████████████████████████████████████████████████████████████| 3.97G/3.97G [07:45<00:00, 9.15MB/s]
64Calculating sha256 for D:\sdnext\stable-diffusion-webui-directml\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors: preload_extensions_git_metadata for 7 extensions took 0.00s
65Running on local URL:  http://127.0.0.1:7860
66To create a public link, set `share=True` in `launch()`.
67Startup time: 479.1s (import torch: 3.3s, import gradio: 2.0s, import ldm: 0.8s, other imports: 4.2s, setup codeformer: 0.3s, list SD models: 466.4s, load scripts: 1.4s, create ui: 0.5s, gradio launch: 0.1s).
686ce0161689b3853acaa03779ec93eafe75a02f4ced659bee03f50797806fa2fa
69Loading weights [6ce0161689] from D:\sdnext\stable-diffusion-webui-directml\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors
70Creating model from config: D:\sdnext\stable-diffusion-webui-directml\configs\v1-inference.yaml
71LatentDiffusion: Running in eps-prediction mode
72DiffusionWrapper has 859.52 M params.
73Applying attention optimization: InvokeAI... done.
74Textual inversion embeddings loaded(0):
75Model loaded in 8.4s (calculate hash: 4.1s, load weights from disk: 0.2s, create model: 0.5s, apply weights to model: 0.8s, apply half(): 0.8s, move model to device: 1.4s, calculate empty prompt: 0.6s).

標準状態で起動させて生成を行っていると途中でクラッシュした

もう1回生成させたらブルースクリーンで止まった。

webui-user.bat をコピーして、 COMMANDLINE_ARGSのある行を「set COMMANDLINE_ARGS=–opt-sub-quad-attention –lowvram –disable-nan-check」に変えることで生成に成功した。

ちゃんとGPUで計算して生成に成功しました。

1PS D:\sdnext\stable-diffusion-webui-directml> .\webui-user2.bat
2venv "D:\sdnext\stable-diffusion-webui-directml\venv\Scripts\Python.exe"
3fatal: No names found, cannot describe anything.
4Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
5Version: ## 1.4.0
6Commit hash: 265d626471eacd617321bdb51e50e4b87a7ca82e
7Installing requirements
8Launching Web UI with arguments: --opt-sub-quad-attention --lowvram --disable-nan-check
9No module 'xformers'. Proceeding without it.
10Warning: caught exception 'Torch not compiled with CUDA enabled', memory monitor disabled
11Loading weights [6ce0161689] from D:\sdnext\stable-diffusion-webui-directml\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors
12preload_extensions_git_metadata for 7 extensions took 0.00s
13Creating model from config: D:\sdnext\stable-diffusion-webui-directml\configs\v1-inference.yaml
14LatentDiffusion: Running in eps-prediction mode
15Running on local URL:  http://127.0.0.1:7860
16To create a public link, set `share=True` in `launch()`.
17Startup time: 11.1s (import torch: 2.8s, import gradio: 1.3s, import ldm: 0.6s, other imports: 3.9s, setup codeformer: 0.1s, load scripts: 1.3s, create ui: 0.7s, gradio launch: 0.4s).
18DiffusionWrapper has 859.52 M params.
19Applying attention optimization: sub-quadratic... done.
20Textual inversion embeddings loaded(0):
21Model loaded in 14.4s (load weights from disk: 0.9s, create model: 0.6s, apply weights to model: 11.6s, apply half(): 0.8s, calculate empty prompt: 0.5s).
22100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [02:32<00:00,  7.64s/it]
23Total progress: 100%|██████████████████████████████████████████████████████████████████| 20/20 [02:29<00:00,  7.48s/it]
24100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [02:30<00:00,  7.54s/it]
25Total progress: 100%|██████████████████████████████████████████████████████████████████| 20/20 [02:28<00:00,  7.44s/it]
26Total progress: 100%|██████████████████████████████████████████████████████████████████| 20/20 [02:28<00:00,  7.63s/it]

4) 出力メッセージの精査

「No module ‘xformers’. Proceeding without it.」はnVidia GPUじゃないと動かないのでこれは正常動作。

5) 学習モデルを持ってくる

参考:Stable Diffusion v2モデル_H2-2023

拡張子safetensorsのファイルは models\Stable-diffusion に配置した。

6) ControlNet追加

ControlNetを web uiに組み込める形にした ControlNet for Stable Diffusion WebUI

(SD.Nextだと組み込み済みだが、オリジナルの方は追加する)

Web GUIの「Extensions」の「Install from URL」に「https://github.com/Mikubill/sd-webui-controlnet.git」を入れて、手順を行う

Modelをhttps://huggingface.co/lllyasviel/ControlNet-v1-1/tree/main からダウンロードする、とあったのだが、既におかれていたので不要なのかなぁ?

とりあえず設定はしてみたけど、まだ使っていない。


追加:Ryzen 7 5800Hの場合

Ryzen 7 5800H環境でも同じように設定してみたのだが、こちらは何も生成しないうちにcontrolenetを組み込んでみたらエラーとなった。

1PS C:\stablediff\stable-diffusion-webui-directml> .\webui-user-amd.bat
2venv "C:\stablediff\stable-diffusion-webui-directml\venv\Scripts\Python.exe"
3fatal: No names found, cannot describe anything.
4Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
5Version: ## 1.4.0
6Commit hash: 265d626471eacd617321bdb51e50e4b87a7ca82e
7Installing requirements
8Launching Web UI with arguments: --opt-sub-quad-attention --lowvram --disable-nan-check --autolaunch
9No module 'xformers'. Proceeding without it.
10Warning: caught exception 'Torch not compiled with CUDA enabled', memory monitor disabled
11reading checkpoint metadata: C:\stablediff\stable-diffusion-webui-directml\models\Stable-diffusion\unlimitedReplicant_v10.safetensors: AssertionError
12Traceback (most recent call last):
13  File "C:\stablediff\stable-diffusion-webui-directml\modules\sd_models.py", line 62, in __init__
14    self.metadata = read_metadata_from_safetensors(filename)
15  File "C:\stablediff\stable-diffusion-webui-directml\modules\sd_models.py", line 236, in read_metadata_from_safetensors
16    assert metadata_len > 2 and json_start in (b'{"', b"{'"), f"{filename} is not a safetensors file"
17AssertionError: C:\stablediff\stable-diffusion-webui-directml\models\Stable-diffusion\unlimitedReplicant_v10.safetensors is not a safetensors file
182023-07-12 13:46:53,471 - ControlNet - INFO - ControlNet v1.1.232
19ControlNet preprocessor location: C:\stablediff\stable-diffusion-webui-directml\extensions\sd-webui-controlnet\annotator\downloads
202023-07-12 13:46:53,548 - ControlNet - INFO - ControlNet v1.1.232
21Loading weights [c348e5681e] from C:\stablediff\stable-diffusion-webui-directml\models\Stable-diffusion\muaccamix_v15.safetensors
22preload_extensions_git_metadata for 8 extensions took 0.13s
23Running on local URL:  http://127.0.0.1:7860
24To create a public link, set `share=True` in `launch()`.
25Startup time: 7.2s (import torch: 2.2s, import gradio: 1.0s, import ldm: 0.5s, other imports: 1.2s, load scripts: 1.3s, create ui: 0.4s, gradio launch: 0.5s).
26Creating model from config: C:\stablediff\stable-diffusion-webui-directml\repositories\stable-diffusion-stability-ai\configs\stable-diffusion\v2-inference-v.yaml
27LatentDiffusion: Running in v-prediction mode
28DiffusionWrapper has 865.91 M params.
29Applying attention optimization: sub-quadratic... done.
30Textual inversion embeddings loaded(0):
31Model loaded in 7.1s (load weights from disk: 0.7s, find config: 2.4s, create model: 0.2s, apply weights to model: 1.9s, apply half(): 1.0s, move model to device: 0.3s, calculate empty prompt: 0.4s).
32Loading weights [e3b0c44298] from C:\stablediff\stable-diffusion-webui-directml\models\Stable-diffusion\unlimitedReplicant_v10.safetensors
33changing setting sd_model_checkpoint to unlimitedReplicant_v10.safetensors [e3b0c44298]: SafetensorError
34Traceback (most recent call last):
35  File "C:\stablediff\stable-diffusion-webui-directml\modules\shared.py", line 610, in set
36    self.data_labels[key].onchange()
37  File "C:\stablediff\stable-diffusion-webui-directml\modules\call_queue.py", line 13, in f
38    res = func(*args, **kwargs)
39  File "C:\stablediff\stable-diffusion-webui-directml\webui.py", line 226, in <lambda>
40    shared.opts.onchange("sd_model_checkpoint", wrap_queued_call(lambda: modules.sd_models.reload_model_weights()), call=False)
41  File "C:\stablediff\stable-diffusion-webui-directml\modules\sd_models.py", line 568, in reload_model_weights
42    state_dict = get_checkpoint_state_dict(checkpoint_info, timer)
43  File "C:\stablediff\stable-diffusion-webui-directml\modules\sd_models.py", line 277, in get_checkpoint_state_dict
44    res = read_state_dict(checkpoint_info.filename)
45  File "C:\stablediff\stable-diffusion-webui-directml\modules\sd_models.py", line 256, in read_state_dict
46    pl_sd = safetensors.torch.load_file(checkpoint_file, device=device)
47  File "C:\stablediff\stable-diffusion-webui-directml\venv\lib\site-packages\safetensors\torch.py", line 259, in load_file
48    with safe_open(filename, framework="pt", device=device) as f:
49safetensors_rust.SafetensorError: Error while deserializing header: HeaderTooSmall
50*** Error completing request
51*** Arguments: ('task(d0d406cu3531u31)', 'miku\n', '', [], 20, 0, False, False, 1, 1, 7, -1.0, -1.0, 0, 0, 0, False, 512, 512, False, 0.7, 2, 'Latent', 0, 0, 0, 0, '', '', [], 0, <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x000001FAA7416110>, False, False, 'positive', 'comma', 0, False, False, '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, 0, None, None, False, 50) {}
52    Traceback (most recent call last):
53      File "C:\stablediff\stable-diffusion-webui-directml\modules\call_queue.py", line 55, in f
54        res = list(func(*args, **kwargs))
55      File "C:\stablediff\stable-diffusion-webui-directml\modules\call_queue.py", line 35, in f
56        res = func(*args, **kwargs)
57      File "C:\stablediff\stable-diffusion-webui-directml\modules\txt2img.py", line 94, in txt2img
58        processed = processing.process_images(p)
59      File "C:\stablediff\stable-diffusion-webui-directml\modules\processing.py", line 623, in process_images
60        res = process_images_inner(p)
61      File "C:\stablediff\stable-diffusion-webui-directml\extensions\sd-webui-controlnet\scripts\batch_hijack.py", line 42, in processing_process_images_hijack
62        return getattr(processing, '__controlnet_original_process_images_inner')(p, *args, **kwargs)
63      File "C:\stablediff\stable-diffusion-webui-directml\modules\processing.py", line 732, in process_images_inner
64        p.setup_conds()
65      File "C:\stablediff\stable-diffusion-webui-directml\modules\processing.py", line 1129, in setup_conds
66        super().setup_conds()
67      File "C:\stablediff\stable-diffusion-webui-directml\modules\processing.py", line 346, in setup_conds
68        self.uc = self.get_conds_with_caching(prompt_parser.get_learned_conditioning, self.negative_prompts, self.steps * self.step_multiplier, [self.cached_uc], self.extra_network_data)
69      File "C:\stablediff\stable-diffusion-webui-directml\modules\processing.py", line 338, in get_conds_with_caching
70        cache[1] = function(shared.sd_model, required_prompts, steps)
71      File "C:\stablediff\stable-diffusion-webui-directml\modules\prompt_parser.py", line 143, in get_learned_conditioning
72        conds = model.get_learned_conditioning(texts)
73      File "C:\stablediff\stable-diffusion-webui-directml\repositories\stable-diffusion-stability-ai\ldm\models\diffusion\ddpm.py", line 665, in get_learned_conditioning
74        c = self.cond_stage_model.encode(c)
75      File "C:\stablediff\stable-diffusion-webui-directml\repositories\stable-diffusion-stability-ai\ldm\modules\encoders\modules.py", line 236, in encode
76        return self(text)
77      File "C:\stablediff\stable-diffusion-webui-directml\venv\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
78        return forward_call(*args, **kwargs)
79      File "C:\stablediff\stable-diffusion-webui-directml\repositories\stable-diffusion-stability-ai\ldm\modules\encoders\modules.py", line 213, in forward
80        z = self.encode_with_transformer(tokens.to(self.device))
81      File "C:\stablediff\stable-diffusion-webui-directml\venv\lib\site-packages\torch\cuda\__init__.py", line 239, in _lazy_init
82        raise AssertionError("Torch not compiled with CUDA enabled")
83    AssertionError: Torch not compiled with CUDA enabled
84---
85*** Error completing request
86*** Arguments: ('task(rw9uda96ly6wovo)', 'miku\n', '', [], 20, 0, False, False, 1, 1, 7, -1.0, -1.0, 0, 0, 0, False, 512, 512, False, 0.7, 2, 'Latent', 0, 0, 0, 0, '', '', [], 0, <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x000001FA000A6620>, False, False, 'positive', 'comma', 0, False, False, '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, 0, None, None, False, 50) {}
87    Traceback (most recent call last):
88      File "C:\stablediff\stable-diffusion-webui-directml\modules\call_queue.py", line 55, in f
89        res = list(func(*args, **kwargs))
90      File "C:\stablediff\stable-diffusion-webui-directml\modules\call_queue.py", line 35, in f
91        res = func(*args, **kwargs)
92      File "C:\stablediff\stable-diffusion-webui-directml\modules\txt2img.py", line 94, in txt2img
93        processed = processing.process_images(p)
94      File "C:\stablediff\stable-diffusion-webui-directml\modules\processing.py", line 623, in process_images
95        res = process_images_inner(p)
96      File "C:\stablediff\stable-diffusion-webui-directml\extensions\sd-webui-controlnet\scripts\batch_hijack.py", line 42, in processing_process_images_hijack
97        return getattr(processing, '__controlnet_original_process_images_inner')(p, *args, **kwargs)
98      File "C:\stablediff\stable-diffusion-webui-directml\modules\processing.py", line 732, in process_images_inner
99        p.setup_conds()
100      File "C:\stablediff\stable-diffusion-webui-directml\modules\processing.py", line 1129, in setup_conds
101        super().setup_conds()
102      File "C:\stablediff\stable-diffusion-webui-directml\modules\processing.py", line 346, in setup_conds
103        self.uc = self.get_conds_with_caching(prompt_parser.get_learned_conditioning, self.negative_prompts, self.steps * self.step_multiplier, [self.cached_uc], self.extra_network_data)
104      File "C:\stablediff\stable-diffusion-webui-directml\modules\processing.py", line 338, in get_conds_with_caching
105        cache[1] = function(shared.sd_model, required_prompts, steps)
106      File "C:\stablediff\stable-diffusion-webui-directml\modules\prompt_parser.py", line 143, in get_learned_conditioning
107        conds = model.get_learned_conditioning(texts)
108      File "C:\stablediff\stable-diffusion-webui-directml\repositories\stable-diffusion-stability-ai\ldm\models\diffusion\ddpm.py", line 665, in get_learned_conditioning
109        c = self.cond_stage_model.encode(c)
110      File "C:\stablediff\stable-diffusion-webui-directml\repositories\stable-diffusion-stability-ai\ldm\modules\encoders\modules.py", line 236, in encode
111        return self(text)
112      File "C:\stablediff\stable-diffusion-webui-directml\venv\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
113        return forward_call(*args, **kwargs)
114      File "C:\stablediff\stable-diffusion-webui-directml\repositories\stable-diffusion-stability-ai\ldm\modules\encoders\modules.py", line 213, in forward
115        z = self.encode_with_transformer(tokens.to(self.device))
116      File "C:\stablediff\stable-diffusion-webui-directml\venv\lib\site-packages\torch\cuda\__init__.py", line 239, in _lazy_init
117        raise AssertionError("Torch not compiled with CUDA enabled")
118    AssertionError: Torch not compiled with CUDA enabled
119---
120*** Error completing request
121*** Arguments: ('task(qgndomumiw4zfai)', 'miku\n', '', [], 20, 0, False, False, 1, 1, 7, -1.0, -1.0, 0, 0, 0, False, 512, 512, False, 0.7, 2, 'Latent', 0, 0, 0, 0, '', '', [], 0, <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x000001FAA6F229E0>, False, False, 'positive', 'comma', 0, False, False, '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, 0, None, None, False, 50) {}
122    Traceback (most recent call last):
123      File "C:\stablediff\stable-diffusion-webui-directml\modules\call_queue.py", line 55, in f
124        res = list(func(*args, **kwargs))
125      File "C:\stablediff\stable-diffusion-webui-directml\modules\call_queue.py", line 35, in f
126        res = func(*args, **kwargs)
127      File "C:\stablediff\stable-diffusion-webui-directml\modules\txt2img.py", line 94, in txt2img
128        processed = processing.process_images(p)
129      File "C:\stablediff\stable-diffusion-webui-directml\modules\processing.py", line 623, in process_images
130        res = process_images_inner(p)
131      File "C:\stablediff\stable-diffusion-webui-directml\extensions\sd-webui-controlnet\scripts\batch_hijack.py", line 42, in processing_process_images_hijack
132        return getattr(processing, '__controlnet_original_process_images_inner')(p, *args, **kwargs)
133      File "C:\stablediff\stable-diffusion-webui-directml\modules\processing.py", line 732, in process_images_inner
134        p.setup_conds()
135      File "C:\stablediff\stable-diffusion-webui-directml\modules\processing.py", line 1129, in setup_conds
136        super().setup_conds()
137      File "C:\stablediff\stable-diffusion-webui-directml\modules\processing.py", line 346, in setup_conds
138        self.uc = self.get_conds_with_caching(prompt_parser.get_learned_conditioning, self.negative_prompts, self.steps * self.step_multiplier, [self.cached_uc], self.extra_network_data)
139      File "C:\stablediff\stable-diffusion-webui-directml\modules\processing.py", line 338, in get_conds_with_caching
140        cache[1] = function(shared.sd_model, required_prompts, steps)
141      File "C:\stablediff\stable-diffusion-webui-directml\modules\prompt_parser.py", line 143, in get_learned_conditioning
142        conds = model.get_learned_conditioning(texts)
143      File "C:\stablediff\stable-diffusion-webui-directml\repositories\stable-diffusion-stability-ai\ldm\models\diffusion\ddpm.py", line 665, in get_learned_conditioning
144        c = self.cond_stage_model.encode(c)
145      File "C:\stablediff\stable-diffusion-webui-directml\repositories\stable-diffusion-stability-ai\ldm\modules\encoders\modules.py", line 236, in encode
146        return self(text)
147      File "C:\stablediff\stable-diffusion-webui-directml\venv\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
148        return forward_call(*args, **kwargs)
149      File "C:\stablediff\stable-diffusion-webui-directml\repositories\stable-diffusion-stability-ai\ldm\modules\encoders\modules.py", line 213, in forward
150        z = self.encode_with_transformer(tokens.to(self.device))
151      File "C:\stablediff\stable-diffusion-webui-directml\venv\lib\site-packages\torch\cuda\__init__.py", line 239, in _lazy_init
152        raise AssertionError("Torch not compiled with CUDA enabled")
153    AssertionError: Torch not compiled with CUDA enabled
154---
155Restarting UI...
156Closing server running on port: 7860
1572023-07-12 13:54:32,359 - ControlNet - INFO - ControlNet v1.1.232
158Running on local URL:  http://127.0.0.1:7860
159To create a public link, set `share=True` in `launch()`.
160Startup time: 0.6s (load scripts: 0.3s, create ui: 0.2s).
161preload_extensions_git_metadata for 8 extensions took 0.15s
162*** Error completing request
163*** Arguments: ('task(jwkb7fcvkg7wpb4)', 'miku', '', [], 20, 0, False, False, 1, 1, 7, -1.0, -1.0, 0, 0, 0, False, 512, 512, False, 0.7, 2, 'Latent', 0, 0, 0, 0, '', '', [], 0, <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x000001FB1BC5F010>, False, False, 'positive', 'comma', 0, False, False, '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, 0, None, None, False, 50) {}
164    Traceback (most recent call last):
165      File "C:\stablediff\stable-diffusion-webui-directml\modules\call_queue.py", line 55, in f
166        res = list(func(*args, **kwargs))
167      File "C:\stablediff\stable-diffusion-webui-directml\modules\call_queue.py", line 35, in f
168        res = func(*args, **kwargs)
169      File "C:\stablediff\stable-diffusion-webui-directml\modules\txt2img.py", line 94, in txt2img
170        processed = processing.process_images(p)
171      File "C:\stablediff\stable-diffusion-webui-directml\modules\processing.py", line 623, in process_images
172        res = process_images_inner(p)
173      File "C:\stablediff\stable-diffusion-webui-directml\extensions\sd-webui-controlnet\scripts\batch_hijack.py", line 42, in processing_process_images_hijack
174        return getattr(processing, '__controlnet_original_process_images_inner')(p, *args, **kwargs)
175      File "C:\stablediff\stable-diffusion-webui-directml\modules\processing.py", line 732, in process_images_inner
176        p.setup_conds()
177      File "C:\stablediff\stable-diffusion-webui-directml\modules\processing.py", line 1129, in setup_conds
178        super().setup_conds()
179      File "C:\stablediff\stable-diffusion-webui-directml\modules\processing.py", line 346, in setup_conds
180        self.uc = self.get_conds_with_caching(prompt_parser.get_learned_conditioning, self.negative_prompts, self.steps * self.step_multiplier, [self.cached_uc], self.extra_network_data)
181      File "C:\stablediff\stable-diffusion-webui-directml\modules\processing.py", line 338, in get_conds_with_caching
182        cache[1] = function(shared.sd_model, required_prompts, steps)
183      File "C:\stablediff\stable-diffusion-webui-directml\modules\prompt_parser.py", line 143, in get_learned_conditioning
184        conds = model.get_learned_conditioning(texts)
185      File "C:\stablediff\stable-diffusion-webui-directml\repositories\stable-diffusion-stability-ai\ldm\models\diffusion\ddpm.py", line 665, in get_learned_conditioning
186        c = self.cond_stage_model.encode(c)
187      File "C:\stablediff\stable-diffusion-webui-directml\repositories\stable-diffusion-stability-ai\ldm\modules\encoders\modules.py", line 236, in encode
188        return self(text)
189      File "C:\stablediff\stable-diffusion-webui-directml\venv\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
190        return forward_call(*args, **kwargs)
191      File "C:\stablediff\stable-diffusion-webui-directml\repositories\stable-diffusion-stability-ai\ldm\modules\encoders\modules.py", line 213, in forward
192        z = self.encode_with_transformer(tokens.to(self.device))
193      File "C:\stablediff\stable-diffusion-webui-directml\venv\lib\site-packages\torch\cuda\__init__.py", line 239, in _lazy_init
194        raise AssertionError("Torch not compiled with CUDA enabled")
195    AssertionError: Torch not compiled with CUDA enabled
196---
197fatal: No names found, cannot describe anything.
198Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
199Version: ## 1.4.0
200Commit hash: 265d626471eacd617321bdb51e50e4b87a7ca82e
201Installing requirements
202Launching Web UI with arguments: --opt-sub-quad-attention --lowvram --disable-nan-check --autolaunch
203No module 'xformers'. Proceeding without it.
204Warning: caught exception 'Torch not compiled with CUDA enabled', memory monitor disabled
205Loading weights [c348e5681e] from C:\stablediff\stable-diffusion-webui-directml\models\Stable-diffusion\muaccamix_v15.safetensors
206preload_extensions_git_metadata for 8 extensions took 0.13s
207Running on local URL:  http://127.0.0.1:7860
208To create a public link, set `share=True` in `launch()`.
209Startup time: 6.6s (import torch: 2.2s, import gradio: 1.0s, import ldm: 0.5s, other imports: 1.2s, load scripts: 1.0s, create ui: 0.5s, gradio launch: 0.2s).
210Creating model from config: C:\stablediff\stable-diffusion-webui-directml\repositories\stable-diffusion-stability-ai\configs\stable-diffusion\v2-inference-v.yaml
211LatentDiffusion: Running in v-prediction mode
212DiffusionWrapper has 865.91 M params.
213Applying attention optimization: sub-quadratic... done.
214Textual inversion embeddings loaded(0):
215Model loaded in 6.3s (load weights from disk: 0.7s, find config: 1.7s, create model: 0.6s, apply weights to model: 1.6s, apply half(): 1.0s, move model to device: 0.3s, calculate empty prompt: 0.4s).
216100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [01:44<00:00,  5.23s/it]
217Total progress: 100%|██████████████████████████████████████████████████████████████████| 20/20 [01:41<00:00,  5.06s/it]
218Total progress: 100%|██████████████████████████████████████████████████████████████████| 20/20 [01:41<00:00,  5.08s/it]

もしかしていきなりcontrole netを有効にしたせいかな?と一度無効化したところ正常動作した。

1回正常動作を確認後、再びctonrole net有効にしたら今度は問題なく動作した・・・なぜ?

生成時間比較

Ryzen 5 5600GとRyzen 7 5800H比較のため、モデルUnlimited Replicantを使って「miku」とだけ指定して生成してみたところ

Ryzen 7 5800Hでの生成時間

1Total progress: 100%|██████████████████████████████████████████████████████████████████| 20/20 [01:39<00:00,  5.03s/it]

Ryzen 5 5600Gでの生成時間

1Total progress: 100%|██████████████████████████████████████████████████████████████████| 20/20 [02:22<00:00,  7.23s/it]
StatCounter - Free Web Tracker and Counter