Confuzu / CivitAI-Model-grabber

The Script Downloads in bulk both model(Lora,Lycoris,Embeding etc..) and related images, from a given CivitAI Username
GNU General Public License v3.0
18 stars 4 forks source link

Incongruency in the calculation of downloaded and missing number of items #14

Closed ElRandom78 closed 1 month ago

ElRandom78 commented 2 months ago

Hi,

it seems that something doesn't work properly with these calculation functions:

Downloaded items for username:...' and Missing items for username:...'

This is my try of a download:

H:\CONFUZU_CivitAI-Model-grabber\venv\Scripts>activate

(venv) H:\CONFUZU_CivitAI-Model-grabber\venv\Scripts>python civitAI_Model_downloader.py nochekaiser881
Please enter your Civitai API token: fe687281f9825ce567f29e3db4d380d2
Please enter the type of content to download (Lora, Checkpoints, Embeddings, Other, or All): Lora
Processing username: nochekaiser881, Download type: Lora
Download completed for username: nochekaiser881
Total items for username: nochekaiser881: 100
Downloaded items for username: nochekaiser881: 100
Missing items for username: nochekaiser881: 100
Missing item names:
Yor Briar (ヨル・ブライア) _ Yor Forger (ヨル・フォージャー) - Spy x Family (スパイファミリー) - COMMISSION W_ DATASET
Hitagi Senjougahara (戦場ヶ原 ひたぎ) - Monogatari Series (物語シリーズ )
Aqua (アクア) - KonoSuba_ God_s Blessing on This Wonderful World! (この素晴らしい世界に祝福を!)
Alice Zuberg (アリス・ツーベルク) - Sword Art Online (ソードアート・オンライン)
Quetzalcoatl (ケツァルコアトル) _ Lucoa - Miss Kobayashi_s Dragon Maid (小林さんちのメイドラゴン)
Inoue Orihime (井上 織姫) - Bleach (ブリーチ) - COMMISSION
Rin Tohsaka (遠坂 凛) - Fate_stay Night - COMMISSION W_ DATASET
Kei Karuizawa (軽井沢 恵) - Classroom of the Elite (ようこそ実力至上主義の教室へ)
Ram (ラム) - Re_Zero (Re:ゼロから始める異世界生活)
Yui Kotegawa (古手川 唯) - To Love Ru (とらぶる)
Nino Nakano (中野 二乃) - The Quintessential Quintuplets (Gotoubun no Hanayome) (五等分の花嫁)
Akane Shinjou (新条 アカネ) - SSSS.Gridman
Emilia (エミリア) - Re_Zero (Re:ゼロから始める異世界生活)
Asuna Yuuki (結城 明日奈) - Sword Art Online (ソードアート・オンライン)
Takina Inoue (井ノ上 たきな) - Lycoris Recoil (リコリス・リコイル)
Misato Katsuragi (葛城 ミサト) - Neon Genesis Evangelion (新世紀エヴァンゲリオン) - COMMISSION
Winry Rockbell (ウィンリィ・ロックベル) - Full Metal Alchemist (鋼の錬金術師)
Mai Sakurajima (桜島 麻衣) - Aobuta_ Rascal Does Not Dream of Bunny Girl Senpai (青春ブタ野郎はバニーガール先輩の夢を見ない)
Tohru (トール) - Miss Kobayashi_s Dragon Maid (小林さんちのメイドラゴン)
Aura the Guillotine (断頭台のアウラ) - Frieren_ Beyond Journey_s End (葬送のフリーレン)
Mami Tomoe (巴 マミ) - Puella Magi Madoka Magica (Mahou Shoujo Madoka★Magica) (魔法少女まどか★マギカ)
Mari Illustrious Makinami (真希波・マリ・イラストリアス) - Neon Genesis Evangelion (新世紀エヴァンゲリオン)
Miku Nakano (中野 三玖) - The Quintessential Quintuplets (Gotoubun no Hanayome) (五等分の花嫁)
Cow Girl (牛飼娘) - Goblin Slayer! (ゴブリンスレイヤー)
Beatrix Amerhauser (ベアトリクス・アメルハウザー) - Zom 100_ Bucket List of the Dead (ゾン100~ゾンビになるまでにしたい100のこと~)
Ereshkigal (エレシュキガル) - Fate Grand Order
Guild Girl (受付嬢) - Goblin Slayer! (ゴブリンスレイヤー)
Lacus Clyne (ラクス・クライン) - Mobile Suit Gundam (機動戦士ガンダム)
Ichika Nakano (中野 一花) - The Quintessential Quintuplets (Gotoubun no Hanayome) (五等分の花嫁)
Kobeni Higashiyama (東山 コベニ) - Chainsaw Man (チェンソーマン)
Mona Megistus (モナ) (莫娜) - Genshin Impact (原神)
Fuyuko Mayuzumi (黛冬 優子) - Idolmaster (アイドルマスター)
Mikan Yuuki (結城 美柑) - To Love Ru (とらぶる)
Fern (フェルン) - Frieren_ Beyond Journey_s End (葬送のフリーレン)
Zero Two (ゼロツー) (02) - Darling in the Franxx (ダーリン・イン・ザ・フランキス)
Tsubasa Hanekawa (羽川 翼) - Monogatari Series (物語シリーズ )
Kita Ikuyo (喜多 郁代) - Bocchi the Rock (ぼっち・ざ・ろっく!)
Chisato Nishikigi (錦木 千束) - Lycoris Recoil (リコリス・リコイル)
Siesta (シエスタ) - The Detective Is Already Dead (Tantei wa Mou, Shindeiru.) (探偵はもう、死んでいる。)
Jibril (ジブリール) - No Game No Life (ノーゲーム・ノーライフ)
Priestess (女神官) - Goblin Slayer! (ゴブリンスレイヤー)
Kurumi Tokisaki (時崎 狂三) - Date A Live (デート・ア・ライブ) - REUPLOAD
Raphtalia (ラフタリア) - The Rising of the Shield Hero (盾の勇者の成り上がり)
Haruna Sairenji (西連寺 春菜) - To Love Ru (とらぶる)
Nana Asta Deviluke (ナナ・アスタ・デビルーク) - To Love Ru (とらぶる)
Ai Hayasaka (早坂 愛) - Kaguya-sama_ Love is War (かぐや様は告らせたい~天才たちの恋愛頭脳戦~)
Marin Kitagawa (喜多川 海夢) - My Dress Up Darling (その着せ替え人形は恋をする)
Golden Darkness (金色の闇) _ Yami (闇) - To Love Ru (とらぶる)
Rei Ayanami (綾波 レイ) - Neon Genesis Evangelion (新世紀エヴァンゲリオン)
Neferpitou (ネフェルピトー) - Hunter x Hunter (ハンター×ハンター)
AnyLoraCleanLinearMix-ClearVAE
Hitori Gotou (後藤 ひとり) - Bocchi the Rock (ぼっち・ざ・ろっく!)
Chika Fujiwara (藤原 千花) - Kaguya-sama_ Love is War (かぐや様は告らせたい~天才たちの恋愛頭脳戦~)
Miku Hatsune (初音ミク) - Vocaloid
Angewomon (エンジェウーモン) - Digimon
Minamoto-no-Raikou (源頼光) - Fate Grand Order
Ishtar (イシュタル) - Fate Grand Order
Noel Shirogane (白銀ノエル) - Hololive
Inori Yuzuriha (楪 いのり) - Guilty Crown (ギルティクラウン)
Rikka Takarada (宝多 六花) - SSSS.Gridman
Suguha Kirigaya (桐ヶ谷 直葉) - Sword Art Online (ソードアート・オンライン)
Itsuki Nakano (中野 五月) - The Quintessential Quintuplets (Gotoubun no Hanayome) (五等分の花嫁)
High Elf Archer (妖精弓手) - Goblin Slayer! (ゴブリンスレイヤー)
Misaki Shokuhou (食蜂 操祈) - A Certain Scientific Railgun (とある科学の超電磁砲)
Junko Enoshima (江ノ島 盾子) - Danganronpa (ダンガンロンパ)
Hestia (ヘスティア) - Is It Wrong to Try to Pick Up Girls in a Dungeon_ (DanMachi) (ダンジョンに出会いを求めるのは間違っているだろうか)
Pout Maiden _ Sword Maiden (剣の乙女) - Goblin Slayer! (ゴブリンスレイヤー)
C.C. "C2, Immortal Witch, Pizza Girl, Zero's Mistress, Grey Witch" - Code Geass: Lelouch of the Rebellion (Code Geass: Hangyaku no Lelouch) (コードギアス 反逆のル ルーシュ)
Makima (マキマ) - Chainsaw Man (チェンソーマン)
Mitsuri Kanroji (甘露寺 蜜璃) - Demon Slayer (鬼滅の刃)
Rory Mercury (ロゥリィ・マーキュリー) - Gate_ Thus the JSDF Fought There! (GATE(ゲート)自衛隊 彼の地にて、斯く戦えり) - REUPLOAD
Darkness (ダクネス) _ Lalatina Dustiness Ford (ダスティネス・フォード・ララティーナ _ ダクネス) - KonoSuba_ God_s Blessing on This Wonderful World! (この素晴らしい世界に祝福を!)
Frieren (フリーレン) - Frieren_ Beyond Journey_s End (葬送のフリーレン)
Hinata Hyuuga (日向ヒナタ) - Naruto (ナルト) - COMMISSION
Tearju Lunatique (ティアーユ=ルナティーク) - To Love Ru (とらぶる)
Kaguya Shinomiya (四宮 かぐや) - Kaguya-sama_ Love is War (かぐや様は告らせたい~天才たちの恋愛頭脳戦~)
Sword Maiden (剣の乙女) - Goblin Slayer! (ゴブリンスレイヤー)
Erina Nakiri ( 薙切 えりな) - Food Wars! (食戟のソーマ) - COMMISSION
Lala Satalin Deviluke (ララ・サタリン・デビルーク) - To Love Ru (とらぶる)
Roxy Migurdia (ロキシー・ミグルディア) - Mushoku Tensei_ Jobless Reincarnation (無職転生 ~異世界行ったら本気だす~)
Rem (レム) - Re_Zero (Re:ゼロから始める異世界生活)
Nodoka Haramura - Saki - COMMISSION
Saten Ruiko (佐天 涙子) - A Certain Scientific Railgun (とある科学の超電磁砲)
Asuka Langley Soryu (惣流・アスカ・ラングレー) - Neon Genesis Evangelion (新世紀エヴァンゲリオン)
Shizuka Mikazuki (三日月 閑) - Zom 100_ Bucket List of the Dead (ゾン100~ゾンビになるまでにしたい100のこと~)
Eris Boreas Greyrat (エリス・ボレアス・グレイラット) - Mushoku Tensei_ Jobless Reincarnation (無職転生 ~異世界行ったら本気だす~)
Albedo (アルベド) - Overlord (オーバーロード)
Tamamo-no-Mae (玉藻の前) - Fate Grand Order
Lucy Heartfilia (ルーシィ・ハートフィリア) - Fairy Tail (フェアリーテイル) - COMMISSION
Tsunade (綱手) - Naruto (ナルト) - COMMISSION
Fubuki (フブキ) - One Punch Man (ワンパンマン)
Momo Belia Deviluke (モモ・ベリア・デビルーク) - To Love Ru (とらぶる)
Chizuru Ichinose (一ノ瀬ちづる) _ Chizuru Mizuhara (水原千鶴) - Rent-a-Girlfriend (Kanojo, Okarishimasu) (彼女、お借りします)
Sakura Haruno (春野サクラ) - Naruto (ナルト) - COMMISSION
Nijika Ijichi (伊地知 虹夏) - Bocchi the Rock (ぼっち・ざ・ろっく!)
Yotsuba Nakano (中野 四葉) - The Quintessential Quintuplets (Gotoubun no Hanayome) (五等分の花嫁)
PA-san (PAさん) - Bocchi the Rock (ぼっち・ざ・ろっく!)
Belldandy (ベルダンディー) - Ah! My Goddess! (ああっ女神さまっ)
Android 18 (人造人間18号) - Dragon Ball (ドラゴンボール)
Himiko Toga (渡我被身子) - My Hero Academia (僕のヒーローアカデミア)
.
.
.
.
.
.
.
.
.
.
.
.
Download completed for username: nochekaiser881
Total items for username: nochekaiser881: 8
Downloaded items for username: nochekaiser881: 8
Missing items for username: nochekaiser881: 7
Missing item names:
Idwal - Dota_ Dragon_s Blood - COMMISSION
Hifumi Yamada (山田 一二三) - Danganronpa (ダンガンロンパ) - COMMISSION
Hoodlum (チンピラ) - Akudama Drive (アクダマドライブ)
Brook _Dead Bones, Soul King_ (ブルック) - One Piece
Kimihiko _Assistant, Singularity, Watson_ Kimizuka (君塚 君彦) - The Detective Is Already Dead (Tantei wa Mou, Shindeiru.) (探偵はもう、死んでいる。)
Ruby - Fortnite - COMMISSION
Yuuji Sakai (坂井 悠二) - Burning-Eyed Shana (Shakugan no Shana) (灼眼のシャナ) - COMMISSION W_ DATASET
End of pagination reached: 'next_page' is None.
Download completed for username: nochekaiser881

(venv) H:\CONFUZU_CivitAI-Model-grabber\venv\Scripts>

you can see the issue right away, in the first block of 100 items: -Total items that has to be downloaded in the 1° block is 100 since like pagination proceed in this way. -'Downloaded items' I interpret it as 'the actual real number of downloaded items that the algorythm has downloaded successfully (=where "ITEMS' are CIVITAI folders, where each one of them can contain one or more files). If the number of downloaded items is 100, the number of missing items can't be 100. It Must be 0. The same way, for the last pagination block : if in the last block there are a total of 8 items, and the algorithm has downloaded succesfully 8 items, the number of Missing items must be 0.

Maybe something doesn't work properly between len() function and set() function, but I'm not sure.

image

In my opinion, this incongruency is caused by the presence of multiple folders that share the same names on CIVITAI. I've chosen nochekaiser881 as example because it suits perfectly for this explanation,

take his Yor Briar files as examples : https://civitai.com/models/117016/yor-briar-yor-forger-spy-x-family https://civitai.com/models/324788/yor-briar-yor-forger-spy-x-family https://civitai.com/models/342830/yor-briar-yor-forger-spy-x-family https://civitai.com/models/99975/yor-briar-yor-forger-spy-x-family-commission-w-dataset

image

Following the algorithm logic, the three folder are downloaded as one, with 8 files inside, and one folder is created apart (because has a different name) with 4 files inside. Thats's ok but in my opinion this can generate confusion in the function that count the number of items downloaded/missed.

Maybe, to overcome this issue, must be found a way to attribute a unique index to each folder ; in this way the algorithm can recognize and count each one of them independently.


The other issue is about 'Missing items printed list':

image

but file named 'Kimihiko' is not missed, has been downloaded like below:

image

image

I also checked, because in my numerous tries It happened that this 'missing item' printed message was showed when there was a specific version missed of 1 file, but this is not the case, because as you can see on the site, there is only 1 version available for this file

https://civitai.com/models/335061/kimihiko-assistant-singularity-watson-kimizuka-the-detective-is-already-dead-tantei-wa-mou-shindeiru image

, so there must be something that trigger unproperly this message.

ElRandom78 commented 2 months ago

To be sure of one thing , I ask you directly: The "Missing item names" visualization message which we talked about before, must be generated by the algorithm in which cases? Only when a model isn't available anymore on the site or also in other cases for other reasons?

Confuzu commented 1 month ago

i have already noticed this myself and am working on a solution

Confuzu commented 1 month ago

I updated the script please try it out and tell me in the issues if the bugs are gone thanks