Giter Club home page Giter Club logo

stable-diffusion-webui-civitai-helper's Introduction

Contributors

Language

中文(ChatGPT) 日本語(ChatGPT) 한국어(ChatGPT)

About Civitai Helper

This extension provides the ability to download models and model metadata from Civitai. Data such as activation keywords, model description, version information, and model previews for models hosted on Civitai can be at your fingertips without having to navigate away from stable diffusion webui.

About This Version of Civitai Helper

This is my personal version of Stable-Diffusion-Webui-Civitai-Helper. I started it entirely because the version I was using broke when SD-webui v1.5 came out and I needed it to work. Since then, I have added functionality that I wanted and have made best-effort attempts to maintain compatibility with older versions of sd-webui, but I do not use older versions and therefore do not test on older versions.

I intend to keep this working for as long as I am able, but this is simply a hobby project and I am nowhere near as skilled as other extension developers with more experience. I am likely to dip out for long periods at a time, possibly forever if I lose interest. I am prone to errors and bugs are to be expected.

If a more interested part decides to pick up development, I will happily cede control of this project and attempt to push my changes to their projects if they are wanted.

Civitai Helper

Stable Diffusion Webui Extension for Civitai, to handle your models much more easily.

Civitai: Civitai Url

Features

  • Scans all models to download model information and preview images from Civitai.
  • Link local model to a civitai model by civitai model's url
  • Download a model(with info and preview) by Civitai Url into SD's model folder or subfolders.
  • Downloading can be resumed if an issue occurs, which is good for large files.
  • Checking all your local models for new versions from Civitai
  • Download a new version directly into SD model folder (with info and preview)
  • Modified Built-in "Extra Network" cards, to add the following buttons on each card:
    • 🖼️: Modified "replace preview" text into this icon
    • 🌐: Open this model's Civitai url in a new tab
    • 💡: Add this model's trigger words to prompt
    • ✏️: Rename model
    • ❌: Remove/Delete model
  • Option to always show additional buttons, to help with touchscreens.
  • To the best of my knowledge, this extension should still work in versions of webui prior to v1.5.0, but it is not tested. I make best-effort attempts to write code that should maintain compatibility with older versions, but if you have run into problems, please file an issue and I'll attempt to resolve it.

Install

Go to SD webui's extension tab, go to Install from url sub-tab. Copy this project's url into it, click install.

Alternatively, download this project as a zip file, and unzip it to Your SD webui folder/extensions.

Everytime you install or update this extension, you need to shutdown SD Webui and Relaunch it. Just "Reload UI" won't work for this extension.

Some functionality from Civitai, like downloading models, requires having an account and adding your API key. See this Wiki Article for more information.

Done.

Branches

Development of this extension happens in three development branches:

  • master: The current version of the extension intended for end users. Out-of-version changes to this branch only exist to hotfix critical issues found after the release of a new version.
  • dev: The active development version of this extension. This will always have the most up-to-date changes but is also the most likely to contain bugs.
  • v1.6ONLY: Not supported and not really intended for anybody except for me. Slowest to update and less tested than other branches, this branch only runs on the latest version of webui. Compatibility code for older versions is actively removed, and whether I'm running it on webui stable or webui dev is in flux. In theory, this is the most optimized version of the extension, but it's often just me chasing waterfalls. Do not submit issues if you use this branch. They will be marked as invalid, closed, and otherwise ignored.
  • Feature Branches: These are branches separated from the main development branches to add new features. They are likely to be in a state of active development and incomplete.

Update Your SD Webui

This extension need to get extra network's cards id. Which is added since 2023-02-06. If your SD webui is an earlier version, you need to update it!

Some of the following information may not up-to-date. Most functionality should be the same or similar, but many changes post-v1.6 have not been documented as of yet. Images may not match 1:1 with the current state of the extension.

Scanning Models

Go to extension tab "Civitai Helper". There is a button called "Scan model".

Click it and the extension will scan all your models to generate SHA256 hashes, using them to retreive model information and preview images from Civitai.

Scanning takes time, just wait until it finish

For each model, it will create two files to save all model info from Civitai. These model info files will be [model_name].civitai.info and [model_name].json in your model folder.

If a model info file already exists, by default it will be skipped. If a model cannot be found in Civitai, a minimal model info file will be created with any information that can be extracted from the model. By default, a model with model pre-existing model info files will not be scanned.

Adding New Models

When you want to grab some new models, you can either download them to the appropriate directory yourself or you can use the built-in model downloader. If you use the Model Downloader, the model information and preview will also be downloaded, along providing the option to download other files, like the model config or VAE.

If you just want to download the models into the appropriate directories yourself, you can simply run a scan again to get new model's information and preview images, although other files like the model config or VAE may be missing. Only new models will be scanned with default options.

Update Image Generation Information

In the same place you can scan a model, you can also scan the model info and the extension will attempt to fill in any missing information from the images themselves. This is a very hit-or-miss process, but if you are trying to get the prompt from an image the "preview image prompt" button and it fails to work, performing this scan may retrieve the information necessary to fix it.

Model Card

The following section is outdated!

The following text block and image only applies to Stable Diffution Webui versions before v1.5.0. While the added buttons are still up-to-date, the "Extra Networks" tab button has been removed and is now always active by default.


(Use this only after scanning finished) Open SD webui's build-in "Extra Network" tab, to show model cards.

Move your mouse on to the bottom of a model card. It will show 4 icon buttons:

  • 🖼: Replace preview (a build-in button, modified from text to icon)
  • 🌐: Open this model's Civitai url in a new tab
  • 💡: Add this model's trigger words to prompt
  • 🏷: Use this model's preview image's prompt
  • ✏️: Rename model
  • ❌: Remove/Delete model

Webui Metadata Editor

As of v1.7.0, this extension also downloads data for Webui's Metadata Editor by default. This data includes information you'd previously have to read unruly JSON files or navigate to Civitai to read.

This data can be accessed by clicking the metadata button on the model card.

Download

To download a model by Civitai Model Page's Url, you need 3 steps:

  • Fill the Civitai URL or Model ID
  • Click "Get Model Info by Civitai Url.
  • It will fill in the details automatically, but you can change several options if you need to, including the model version, which subfolder to download the model to, and which optional files to download with the model, if any.
    • If you need to add more sub-folders, you must do this by navigating to the model directory on the system running your webui version.
  • Click download.

Detail will be displayed on console log, with a progress bar. Downloading can be resumed on failure, so no fear of having to restart large files.

Checking Model's New Version

You can checking your local model's new version from civitai by model types. You can select multiple model types.

The checking process has a small delay after each model's new version checking request. So it is a little slow.

This is to protect Civitai from issue like DDos from this extension. There is no good for us if it is down.

After checking process done, it will display all new version's information on UI.

There are 3 urls for each new version.

  • First one is model's civitai page.
  • Second one is new version's download url.
  • Third one is a button to download it into your SD's model folder with python. With this one, output information is on "Download Model" section's log and console log. One task at a time.

Get Model Info By Url

This is used to force a local model links to a Civitai model. For example, you converted a model's format or pruned it. Then it can not be found on civitai when scanning.

In that case, if you still want to link it to a civitai model. You can use this funcion.

Choose this model from list, then offer a civitai model page's url.

After clicking button, extension will download that civitai model's info and preview image for the local file you picked.

Preview Image

Extra networks use both model_file.png and model_file.preview.png as preview image. But model_file.png has higher priority, because it is created by yourself.

When you don't have the higher priority one, it will use the other automatically. SD WebUI also supports other filetypes for previews but .png files will always have priority over every other filetype. For instance, model_file.jpg will supercede model_file.preview.jpg but not model_file.preview.png.

Prompt

When you click the button "Use prompt from preview image", it does not use the prompt from your own preview image. It uses the one from civitai's preview image.

On civitai, a model's preview images may not has prompt. This extension will check this model's all civitai preview images' information and use the first one has prompt in it.

SHA256

To create a file SHA256, it need to read the whole file to generate a hash code. It gonna be slow for large files.

Also, extension uses Memory Optimized SHA256, which won't stuck your system and works with colab.

There are 2 cases this hash code can not find the model on civitai:

  • Some old models, which do not have SHA256 code on civitai.
  • The model's owner changed file on civitai, but does not change version name and description. So, the file on civitai is actually not the one on your manchine.

In these cases, you can always link a model to civitai by filling its URL in this extension.

Settings

While many options are provided in the Civitai Helper's extension tab, a dedicated settings section can be found in WebUI's Setting's tab. Here you will find a variety of options that are either not available in the Civitai Helper tab or that can be set here so that they do not reset when you reload the page. For example, you can hide buttons added by the extension that you do not use, enable always showing buttons to make functionality more touch-screen friendly, or choose to download the highest resolution versions of preview images available.

The next couple sections explain some of the more advanced option.

API Key

Some models on Civitai require you to be logged in to download them. Unfortunately, it is not currently possible to just enter in your login information with this extension, but with an API Key, you will still be able to download these models. For information on how to generate an API Key for your Civitai account, please see our wiki.

Proxy

You may set a proxy for the extension to use and then all requests to civitai will use the proxy.

For some sock5 proxies, you may need to enter it in the form "socks5h://xxxxx".

Choosing a Hashing function

For the longest time, this extension used its own code for performing Hashng, or fingerprinting, of model files. While this worked fine, and was quite good, this implementation had a finicky history with colabs and lacked some useful features like saving generated hashes so that future scans wouldn't need to re-hash the file. While the old implementation is still available through this setting, currently the default setting is to simply let WebUI handle that functionality and benefit from the exceptional development happening over there.

Lycoris Models

By default, models known as "Lycoris" are saved to their own directory, but you can also choose to instead download them to the Lora directory instead. For most end-user purposes, LyCoris models are functionally the same as Loras, so this may be benefical if you simply want everything in one place. However, some extensions previously required LyCoris models to have their own directory, so the default will continue to be to keep them in separate directories for compatibility reasons.

Other Setting

  • "Show Buttons on Thumb Mode" will turn on/off additional Buttons on thumbnail.
    • Thumbnail Mode was removed in v1.5.0 of webui.

Feature Request

Feel free to submit feature requests, but pull requests are preferred.

Enjoy!

Pull Requests

All pull requests should target the dev branch. For those who take a stab at the code, I apologize for the lack of consistency in coding style, naming, and other syntactical oddities. At some point, I intend to clean up the code and have everything pass linting, but we're not there yet.

Common Issue

Buttons on card didn't show

Localization

There was a Localization issue if you are not using English version of SD webui. This is fixed in the latest version of this extension. Bilingual localization extension is supported by PR since v1.6.1.1.

Using cloud based localization extension

Turn off cloud based localization extension, use normal localization extension.

Other case

First of all, make sure you clicked "Refresh Civitai Helper" button.

If issue is still there, then only reason is you are not using the latest SD webui. So, Make sure you updated it.

Your update could be failed if you have modified SD webui's file. You need to check git command's console log to make sure it is updated.

In many cases, git will just refuse to update and tell you there are some conflicts need you to handle manually. If you don't check the consloe log, you will think your SD webui is updated, but it is not.

Request, Scan or Get model info failed

Usually the reason for this most likely is the connection to Civitai API service failed. This can be for a number of reasons.

Sometimes Civitai can be down or refuse your API connection. Civitai has a connection pool setting. Basicly, it's a max connection number that civitai can have at the same time. So if there are already too manny connections on civitai, it will refuse your API connection.

In those cases, the only thing you can do is just wait a while then try again. I suggest making a cup of tea!

Get Wrong model info and preview images from civitai

A bad news is, some models are saved with a wrong sha256 in civitai's database. Check here for more detail: civitai/civitai#426

So, for those models, this extension can not get the right model info or preview images.

In this case, you have to remove the model info file and get the right model info by a civitai url on this extension's tab page.

Also, you can report those models with wrong sha256 to civitai at following page: https://discord.com/channels/1037799583784370196/1096271712959615100/1096271712959615100

Please report that model to civitai, so they can fix it.

Scanning fail when using colab

First of, search your error message with google. Most likely, it will be a colab issue.

If you are sure it is a out of memory issue when scanning models, and you are using this extension's latest version, then there is nothing we can do.

Since v1.5.5, we've already optimized the SHA256 function to the top. So the only 2 choices for you are:

  • try again
  • or use a pro account of colab.

stable-diffusion-webui-civitai-helper's People

Contributors

aylz10 avatar bluelovers avatar butaixianran avatar chrme avatar codepiano avatar etokapa avatar f3l1x98 avatar godsfoot avatar hjnasd avatar infinitewarp avatar jcsmirnio avatar journey-ad avatar l4ph avatar milly avatar mx avatar nosdregamon avatar sdy623 avatar shiux-lab avatar simonmcnair avatar totob12 avatar tranzmatt avatar w-e-w avatar xmiaocat avatar zixaphir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

stable-diffusion-webui-civitai-helper's Issues

[Bug] Lora that breaks the display of other Lora in folders

Describe Issue

Lora that breaks the display of other Lora in folders

If the problematic Lora is in folder 1, some or all of the Lora in folder 2 will disappear, but if you move the Lora from 2 to 1 or to the main Lora folder, it will reappear.

This problem occurred in the latest update of the Civitai Helper, when it started to create a JSON file for each Lora.

The problem turned out to be in the json file, specifically in the description section.

"description": "Train LoRa is time and resource expensive, you can support my future works here:\u2764\ufe0fBoosty Donation linkAstarotte no omocha!\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n\n\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\n\n\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n\n\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\n\n\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\n\n\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\n\n\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\n\n\n\n\n\nResize, rename to usable format(<title>_), compile to one civit page, and made this page look fine.\n\nIt's same as old one, but much less size with little lost in quality(yes older is seems little better in details, but not so much).\n\n\n\n\n\n",

Here is a link to Lora, all Lora from this page have this problem due to the same description.

https://civitai.com/models/63708?modelVersionId=68326

Screenshot for UI issue

If I remove the descriptions from the problematic Lora json file, all Lora work fine.

1
2

Feature Request: Select Alternative Images from CivitAI

It would be great if we could select different CivitAI images for the Checkpoints from the A1111 interface.

For example, I have a bunch of NSFW models simply because of the quality (I end up clothing them) but theres always a few preview images on CivitAI that might be SFW and I'd rather use those as the preview in case someone else sees this.

Cannot find the proxy textbox

Have you read document?

Yes

Have you checked console log window's msg?

Yes

Describe Issue

As a user from CN, I need to setup proxy to download from civitai. It is written in the introduction of this project that "Proxy textbox is at the bottom of extension tab". However, I simply cannot find it. I am running the v1.8.0 version of sd_civitai_helper and v1.6.0 of webui

Screenshot for UI issue

Console log's msg or screenshot for function issue

BUG: "Always Display Buttons"

"Always Display Buttons" in the settings menu is not saved. So everytime you restart SD you have to set it again.

updating .pt model metadata fails with error, "not a safetensors file" rather than moving on

After updating to the latest version of the plugin, the "scan" process now fails with an error when I try to update metadata.

The console reports the following:

File "C:\Utilities\stable-diffusion-webui\modules\sd_models.py", line 269, in read_metadata_from_safetensors
assert metadata_len > 2 and json_start in (b'{"', b"{'"), f"{filename} is not a safetensors file"
AssertionError: C:\Utilities\stable-diffusion-webui\embeddings\AnimeScreenCap.pt is not a safetensors file

Anything that's not a safetensors file (such as most embeddings) that can't be found on CivitAI will trigger this behavior, not just that particular file.

I'm guessing this is related to the feature added in v1.7.3:

When a model is not found on Civitai, this extension will attempt to read the model header for activation keywords. This only works with safetensors files with kohya_ss metadata and may be inaccurate depending on how the model was trained. [...]

The immediate cause is line 176 in scripts/model_action_civitai.py:

file_metadata = sd_models.read_metadata_from_safetensors(path)

I was able to work around the problem by wrapping the line in a try/except loop:

try:
   file_metadata = sd_models.read_metadata_from_safetensors(path)
except:
   return model_info

but I suspect there's a better way to do this.

[Feature] Backup existing metadata before overwriting.

Hello, I am currently looking for feedback from users before I undertake developing this. Please reply with any suggestions, alterations, or preferences on the following. :)

Currently when metadata is overwritten, no care is taken to preserve existing data. While ideally an overwrite would only be performed with pristine, flawless data that never removes useful existing data, the fact of the matter is that on top of accidental mistakes on our end, there are also often cases we cannot control, like a model author replacing their model description with garbage data or an API serving an incorrect/mangled response. In these cases, having a backup or even the option to make a backup to restore the old data from can alleviate user anxiety and provide a nice safety net against accidental data loss.

Since our metadata is primarily tiny text files, these backups would also occupy minimal space.

Additionally, an option should exist to remove older backups.

Proposed implementation:

In addition to the current option to replace old metadata formats, an additional option should be added to create a backup of old metadata. This option should be enabled by default.

Backed-up files should be easily identifiable and easily removable. An option to remove backups older than a given time period should also exist, perhaps customizable by the user, but with a sane default, such as "older than 7 days."
I propose a filename format of [old-filename].[timestamp].bak that contains the previous full filename and a timestamp, likely in Unix format. Another option is to use a compressed format, named [model-name]-backup-[timestamp].[format], with format being some compressed format, such as gz or zip, and all model-metadata (civitai.info and json) being packaged. However, a compressed implementation such as this would likely accrue additional development costs and require pulling in additional module imports.

'Download Max Size Preview' not working

Have you read document?

Yes.

Have you checked console log window's msg?

Yes.

Describe Issue

I have "Download Max Size Preview" checked ("ch_max_size_preview": true), but the previews are still downloaded compressed from the main page at a resolution of 450x675 instead of downloading the original uncompressed ones at a resolution of 1024x1536.

Console log's msg or screenshot for function issue

Civitai Helper: Getting model info by: https://civitai.com/models/134215/meichilightmix
Civitai Helper: Run get_model_id_from_url
Civitai Helper: Request model info from civitai: 134215
Civitai Helper: Get subfolder for: D:\stable-diffusion-webui\models\Stable-diffusion
Civitai Helper: Got following info for downloading:
   model_name: 'MeichiLight_Mix'
   model_type: 'ckp'
   version_strs: ['MeichiLight_Mix V2.0_224422', 'v1.0_147809']
   subfolders: ['/']
   previews: {'MeichiLight_Mix V2.0_224422': [{'url': 'https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/17c1931e-9658-4f03-adf3-b966d32c1a96/width: 450/3608386.jpeg', 'nsfw': 'Mature', 'width': 1024, 'height': 1536, 'hash': 'U7G*Wr000e-AX,00tk-o00~Ux^%2NIIq4o~U', 'type': 'image', 'metadata': {'hash': 'U7G*Wr000e-AX,00tk-o00~Ux^%2NIIq4o~U', 'size': 2325103, 'width': 1024, 'height': 1536}, 'meta': {'Size': '512x768', 'seed': 4294686890, 'Model': 'Only meichi real 2 oda plus.fp16', 'steps': 20, 'hashes': {'model': '57d2ddc49c'}, 'prompt': 'a female elf with a sexy body figure, hunting, medieval theme, pointy ears, ((MILF)), seducing smile, seducing looking, \n(((masterpiece))), ((best quality)), ((intricate detailed)), a sexy woman with elf attributes cloths, (huge breast), bracers, pauldrons, perspective, highly detailed, illustration, 1 girl, perfect hands, detailed fingers, beautiful detailed eyes, long hair, blonde hair (fantasy:1.2), armor, detailed background, at the castle, bedroom, royal, painting on the wall, fierce look, looking at the viewer, from the front,', 'Version': 'v1.3.0', 'sampler': 'DPM++ SDE Karras', 'cfgScale': 7, 'clipSkip': 2, 'resources': [{'hash': '57d2ddc49c', 'name': 'Only meichi real 2 oda plus.fp16', 'type': 'model'}], 'Model hash': '57d2ddc49c', 'Hires steps': '15', 'Hires upscale': '2', 'Hires upscaler': 'R-ESRGAN 4x+ Anime6B', 'negativePrompt': '(worst quality, low quality:2), monochrome, zombie,overexposure, watermark,text, ((bad anatomy, bad proportions)), bad composition, too many fingers,fused fingers,bad arm,distorted arm,extra arms,fused arms,extra legs,missing leg,disembodied leg,extra nipples, detached arm, liquid hand,inverted hand,disembodied limb, small breasts, loli, oversized head,extra body,completely nude, extra navel,easynegative,(hair between eyes),sketch, duplicate, ugly, huge eyes, text, logo, worst face, (bad and mutated hands:1.3), (blurry:2.0), horror, geometry, bad_prompt, ((anime_badhandv4, bad-hands-5)), (bad hands), (broken hands, broken fingers, deformed hands, deformed fingers, missing fingers, missing hands, extra fingers, extra hands:1.5), multiple limbs, (interlocked fingers:1.2), Ugly Fingers, (extra digit and hands and fingers and legs and arms:1.4), ((2girl)), (deformed fingers:1.2), (long fingers:1.2),(bad-artist-anime), bad-artist, bad hand, extra legs ,(ng_deepnegative_v1_75t), ((deformed body)), ((awkward pose, bad pose)), over saturated,outdoors, ( white skin:1.4),', 'ADetailer model': 'face_yolov8n.pt', 'ADetailer prompt': '" \\"beautiful detailed green eyes,detailed lips,eye shadow,detailed face,looking at viewer,face blush,pout\\""', 'Noise multiplier': '0', 'ADetailer version': '23.7.1', 'Denoising strength': '0.5', 'ADetailer mask blur': '4', 'ADetailer confidence': '0.3', 'ADetailer dilate/erode': '32', 'ADetailer inpaint padding': '0', 'ADetailer negative prompt': '"easynegative', 'ADetailer denoising strength': '0.4', 'ADetailer inpaint only masked': 'True'}}...
Civitai Helper: Searching local model by version id
Civitai Helper: folder: D:\stable-diffusion-webui\models\Stable-diffusion\
Civitai Helper: version_id: 224422
Civitai Helper: Start downloading from: https://civitai.com/api/download/models/224422
Civitai Helper: Target file path: D:\stable-diffusion-webui\models\Stable-diffusion\meichilightMix_meichilightMixV20.safetensors
Civitai Helper: File size: 5234115818 (4.87G)
Civitai Helper: Downloading to temp file: D:\stable-diffusion-webui\models\Stable-diffusion\meichilightMix_meichilightMixV20.safetensors.downloading
100%|████████████████████████████████████████████████████████████████████████████| 4.87G/4.87G [08:19<00:00, 10.5MiB/s]
Civitai Helper: File Downloaded to: D:\stable-diffusion-webui\models\Stable-diffusion\meichilightMix_meichilightMixV20.safetensors
Civitai Helper: Request version info from civitai
Civitai Helper: Fetching Parent Model Information
Civitai Helper: Request model info from civitai: 134215
Civitai Helper: Write model civitai info to file: D:\stable-diffusion-webui\models\Stable-diffusion\meichilightMix_meichilightMixV20.civitai.info
Civitai Helper: Write model webui info to file: D:\stable-diffusion-webui\models\Stable-diffusion\meichilightMix_meichilightMixV20.json
Civitai Helper: Downloading model image.
Civitai Helper: Checking preview image for model: D:\stable-diffusion-webui\models\Stable-diffusion\meichilightMix_meichilightMixV20.safetensors
Civitai Helper: Start downloading from: https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/17c1931e-9658-4f03-adf3-b966d32c1a96/width=450/3608386.jpeg
Civitai Helper: Target file path: D:\stable-diffusion-webui\models\Stable-diffusion\meichilightMix_meichilightMixV20.preview.png
Civitai Helper: File size: 71766 (70.08K)
Civitai Helper: Downloading to temp file: D:\stable-diffusion-webui\models\Stable-diffusion\meichilightMix_meichilightMixV20.preview.png.downloading
100%|█████████████████████████████████████████████████████████████████████████████| 70.1k/70.1k [00:00<00:00, 946kiB/s]
Civitai Helper: File Downloaded to: D:\stable-diffusion-webui\models\Stable-diffusion\meichilightMix_meichilightMixV20.preview.png
Civitai Helper: Done. Downloaded to: D:\stable-diffusion-webui\models\Stable-diffusion\meichilightMix_meichilightMixV20.safetensors

Caution: Soft NSFW!
The compressed image I'm getting

Full-size image

Bug/Request: ADetailer Generation Info from CivitAI/Images Not Importing

Have you read document? y

Have you checked console log window's msg? y

Describe Issue:

ADetailer Generation Info from CivitAI/Images Not Importing. I tried loading in the preview via Txt2Img and noticed that the ADetailer information stayed the same. Then I tried it via manually copying the data directly from CivitAI, pasting it into the prompt then reading the info and the ADetailer information filled itself out.

This was the checkpoint and image I had tried copying: https://civitai.com/images/1858744

How to add trigger words to loras?

I can see that i can "💡: Add this model's trigger words to prompt", but regular a1111 already has that feature and you can write your own list of tokens, except it don't work for XYZ prompt. Presumably your (or rather goldmojo's) extension pulls the trigger words from the civit page, but not all uploaders are smart enough to add the triggers to the correct field and instead post them in the description. So how can i add them manually myself, and do they work with XYZ prompt? Since im only looking for a way to add trigger words for XYZ prompt since i only make grids with multiple loras.

[Bug] Still losing information

Related to close issue #11

It still seems to delete information. I attached two files you can test on.

3d Render Style XL Attached File
The model has been deleted. I think this is one from 1.7.0 but I am not sure. It should be able to extract all the information as it was created by the addon.

Possible checking method:

  1. Check if file exists online. If it does then get information from the web and merge trigger words from old file with new one, as user may manually add words.

  2. If file does not exist online, check if "version info" property exist, then you realise the file contains a merger between Model and Model Version JSON data. The data should be updated accordingly.

  3. If file does not exist online, and "version info" property does not exist. It means, this is an older version and it is only contains the Model Version JSON data. The JSON data should be kept and updated.

Luffy Attached File
Luffy (This one I created manually). This one is not so important, but it would be nice if it can just transfer the trigger words (or as much info as possible).

Thank you

3d_render_style_xl.civitai.info.txt
Luffy.info.txt

1.6.0 Startup error is reported

*** Error loading script: civitai_helper.py
Traceback (most recent call last):
File "D:\StabilityMatrix\Data\Packages\stable-diffusion-webui\modules\scripts.py", line 382, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "D:\StabilityMatrix\Data\Packages\stable-diffusion-webui\modules\script_loading.py", line 10, in load_module
module_spec.loader.exec_module(module)
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "D:\StabilityMatrix\Data\Packages\stable-diffusion-webui\extensions\Stable-Diffusion-Webui-Civitai-Helper\scripts\civitai_helper.py", line 31, in
"add_trigger_words_button": util.newer_version(util.webui_version(), '1.5.0', allow_equal=True),
File "D:\StabilityMatrix\Data\Packages\stable-diffusion-webui\extensions\Stable-Diffusion-Webui-Civitai-Helper\scripts\ch_lib\util.py", line 253, in newer_version
return parse_version(ver1) >= parse_version(ver2)
File "D:\StabilityMatrix\Data\Packages\stable-diffusion-webui\venv\lib\site-packages\packaging\version.py", line 52, in parse
return Version(version)
File "D:\StabilityMatrix\Data\Packages\stable-diffusion-webui\venv\lib\site-packages\packaging\version.py", line 196, in init
match = self._regex.search(version)
TypeError: expected string or bytes-like object

[Features] Better Icons

For icons:

  1. When you select rename, the default value is an empty string. Consider filling it with current name.
  2. Maybe consider using a link for "Open this model civitai" rather than an click event
  3. Gray out icons when there is no data associated with it. So if no url link or prompt information then appropriate icon should be grayed out.

QoL request: "show folders" checkbox needs a re-think

## Have you read document?
Yes

## Have you checked console log window's msg?
Yes

## Describe Issue
More of a feature request / QoL than an issue!
TL;DR, scroll down to the bold+italic text below.

There is a checkbox labelled "Show dirs"...

I thought the "Show Dirs" checkbox would help me organize Loras into categories, but no such luck.

When selecting "show dirs", currently it makes a button/shortcut for ALL folders AND subfolders.
Doesn't sound so bad... yet....

Now, I (like others?) keep each Lora in it's own folder. This is neat. Inside each is the lora (safetensors etc), the info, preview thumbnail, and also a lot of example of what the Lora does.

But I also sort Loras into categories. EG, Loras for artist styles, loras for detail helpers, loras for concepts, etc.
Some also have a 2nd (3rd? Depends how you count) level.
Eg

  • Art Style
    • Anime
      • Anime Show Styles
      • Artist Styles
      • Anime Concepts
        - Traditional
  • Character Helpers
    • Design Sheets
    • Character Concept Design
  • Detail Helpers
  • Clothing

and so on. As you can see, some branches have 1 level, some have 2 and some have 3.

When we tick on "show folders", it shows the top level, then sub 1 and sub 2, but also a folder for every lora inside every category! There's a button for every single lora - not just organisation folders. We don't need a folder button for the individual Loras, as the model cards are visible. But we should keep the buttons for top level directories.

Is there a way we can show folders, and however many subfolders, but NOT the folder of an individual lora?
I realise this is tricky. I have a small coding ability but this is beyond me.

It would need to travel the folder tree and all branches, but then remove from it's list any folder of an individual lora. Obviously filtering by "1 level" or "2 levels" doesn't work, when some branches only have 1 level and some have 2. If you filtered 2 levels, then we'd still get all the individual lora folders from branches that only had one level.

Worst case - I would like to see a checkbox to limit folder shortcut buttons to "top level only" and I'll flatten my folder tree. Even that would be an improvement.

Hope you agree this could be helpful. A lot of us have... a LOT of Loras and stuff.
Thanks!

## Screenshot for UI issue
N/A

## Console log's msg or screenshot for function issue
N/A

Feature Request: Download all sample images

I think it would be a nice feature to have the ability to optionally download all the sample images and be able to view them in a slideshow. Like another button on the preview to open a slideshow. Could just have the additional images named something like loraname.preview.1.png loraname.preview,2.png.

[Feature]为是否生成.json文件添加开关

可否为是否生成.json文件添加控制开关
我修改了sd-webui的modules\extra_networks.py使其可以直接读取civitai.info文件的元数据,当我需要更改模型信息、描述内容、自动选择vae等信息时,直接保存为json文件的数据,并且可以直接在文件夹中看有没有json文件可以很直观的判断出哪些是自己修改了内容,哪些使用的是原始的civitai元数据.如果每个模型都生成civitai.info和.json文件,那么就失去了这个便利的判断方法

[Bug] 'Scan Models for Civitai' Does Not Complete

Issue Description & Error Message

When attempting to scan using 'Scan Models for Civitai', the following error occurs.
This happens regardless of the 'Block NSFW Level' setting, which includes ['None', 'Soft', 'Mature', 'X', 'Allow All'].

Traceback (most recent call last):
  File "D:\Programs_D\_MachineLearning\StableDiffusion_0301\python\lib\site-packages\gradio\routes.py", line 488, in run_predict
    output = await app.get_blocks().process_api(
  File "D:\Programs_D\_MachineLearning\StableDiffusion_0301\python\lib\site-packages\gradio\blocks.py", line 1431, in process_api
    result = await self.call_function(
  File "D:\Programs_D\_MachineLearning\StableDiffusion_0301\python\lib\site-packages\gradio\blocks.py", line 1117, in call_function
    prediction = await utils.async_iteration(iterator)
  File "D:\Programs_D\_MachineLearning\StableDiffusion_0301\python\lib\site-packages\gradio\utils.py", line 350, in async_iteration
    return await iterator.__anext__()
  File "D:\Programs_D\_MachineLearning\StableDiffusion_0301\python\lib\site-packages\gradio\utils.py", line 343, in __anext__
    return await anyio.to_thread.run_sync(
  File "D:\Programs_D\_MachineLearning\StableDiffusion_0301\python\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "D:\Programs_D\_MachineLearning\StableDiffusion_0301\python\lib\site-packages\anyio\_backends\_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "D:\Programs_D\_MachineLearning\StableDiffusion_0301\python\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "D:\Programs_D\_MachineLearning\StableDiffusion_0301\python\lib\site-packages\gradio\utils.py", line 326, in run_sync_iterator_async
    return next(iterator)
  File "D:\Programs_D\_MachineLearning\StableDiffusion_0301\python\lib\site-packages\gradio\utils.py", line 695, in gen_wrapper
    yield from f(*args, **kwargs)
  File "D:\Programs_D\_MachineLearning\StableDiffusion_0301\stable-diffusion-webui\extensions\Stable-Diffusion-Webui-Civitai-Helper\scripts\ch_lib\model_action_civitai.py", line 157, in scan_model
    for _ in civitai.get_preview_image_by_model_path(
  File "D:\Programs_D\_MachineLearning\StableDiffusion_0301\stable-diffusion-webui\extensions\Stable-Diffusion-Webui-Civitai-Helper\scripts\ch_lib\civitai.py", line 463, in get_preview_image_by_model_path
    for result in verify_preview(
  File "D:\Programs_D\_MachineLearning\StableDiffusion_0301\stable-diffusion-webui\extensions\Stable-Diffusion-Webui-Civitai-Helper\scripts\ch_lib\civitai.py", line 378, in verify_preview
    if should_skip(nsfw_preview_threshold, image_rating):
  File "D:\Programs_D\_MachineLearning\StableDiffusion_0301\stable-diffusion-webui\extensions\Stable-Diffusion-Webui-Civitai-Helper\scripts\ch_lib\civitai.py", line 363, in should_skip
    return order.index(image_rating) >= order.index(user_rating)
ValueError: False is not in list

Relevant Source Code

def should_skip(user_rating, image_rating):
    """ return: True if preview_nsfw level higher than user threshold """
    order = NSFW_LEVELS
    if user_rating == "Skip":
        # Old config
        return False
    return order.index(image_rating) >= order.index(user_rating)

Steps Taken

Upon investigating with print debugging, it was discovered that the error occurs when image_rating is False.

['None', 'Soft', 'Mature', 'X', 'Allow All']
Allow All <class 'str'>
False <class 'bool'>

As a temporary fix, I modified the function to return False in this case.
This allowed the process to complete.
However, this is likely not the proper solution.
The root cause remains unknown.
Assistance in resolving this would be appreciated.

def should_skip(user_rating, image_rating):
    """ return: True if preview_nsfw level higher than user threshold """
    order = NSFW_LEVELS
    print(order)
    print(user_rating, type(user_rating))
    print(image_rating, type(image_rating))
    if (user_rating == "Skip") or (image_rating is False):
        # Old config
        return False
    return order.index(image_rating) >= order.index(user_rating)

[Bug]额外网络模型卡片上的按钮错误

webui版本1.6.0
civitai help版本 0f56bea
1.当在设置里勾选隐藏replace preview按钮时,所有的按钮均不可见,当不勾选隐藏replace preview按钮时,其他按钮隐藏功能正常
2.鼠标移动到Rename model按钮时,描述为Remove this model
3.鼠标移动到replace preview按钮时无描述
4.当使用lobe theme界面美化插件时,超过4个的按钮不显示
5.当使用lobe theme界面美化插件时,如果设置显示的按钮大于4个时,切换到lora选项卡,会出现2个replace preview按钮,点击使用附加网络刷新按钮时,按钮恢复正常。如果设置显示的按钮小于4个时此问题依旧且使用刷新按钮无法恢复正常

AttributeError: module 'launch' has no attribute 'git_tag'

Have you read document?

Yes.

Have you checked console log window's msg?

Yes. Attached.

Describe Issue

After an update to

https://github.com/vladmandic/automatic

the extension now fails because git_tag does exists. Perhaps a try/except clause to directly invoke the git statement if it doesn't exist?

Console log's msg or screenshot for function issue

12:18:03-963256 ERROR    Module load: extensions/Stable-Diffusion-Webui-Civitai-Helper/scripts/civitai_helper.py: AttributeError                                                                            
╭───────────────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────────────────────────────────────────────╮
│ /home/sd/automatic-stable-diffusion-webui/modules/script_loading.py:21 in load_module                                                                          │
│                                                                                                                                                                                                      │
│   20 │   │   │   with contextlib.redirect_stdout(io.StringIO()) as stdout:                                                                                                                           │
│ ❱ 21 │   │   │   │   module_spec.loader.exec_module(module)                                                                                                                                          │
│   22 │   │   │   setup_logging() # reset since scripts can hijaack logging                                                                                                                           │
│ in exec_module:883                                                                                                                                                                                   │
│ in _call_with_frames_removed:241                                                                                                                                                                     │
│                                                                                                                                                                                                      │
│ /home/sd/automatic-stable-diffusion-webui/extensions/Stable-Diffusion-Webui-Civitai-Helper/scripts/civitai_helper.py:31 in <module>                            │
│                                                                                                                                                                                                      │
│    30 │   "open_url_button": False,                                                                                                                                                                  │
│ ❱  31 │   "add_trigger_words_button": util.newer_version(util.webui_version(), '1.5.0', allow_                                                                                                       │
│    32 │   "add_preview_prompt_button": False,                                                                                                                                                        │
│                                                                                                                                                                                                      │
│ /home/sd/automatic-stable-diffusion-webui/extensions/Stable-Diffusion-Webui-Civitai-Helper/scripts/ch_lib/util.py:433 in webui_version                         │
│                                                                                                                                                                                                      │
│   432 │   version = None                                                                                                                                                                             │
│ ❱ 433 │   tag = launch.git_tag()                                                                                                                                                                     │
│   434 │   match = re.match(r"v([\d.]+)", tag)                                                                                                                                                        │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: module 'launch' has no attribute 'git_tag'

Scan model error

Have you read document?

Yes

Have you checked console log window's msg?

Yes

Describe Issue

Scan model error

Screenshot for UI issue

Console log's msg or screenshot for function issue

ERROR:asyncio:Exception in callback H11Protocol.timeout_keep_alive_handler()
handle: <TimerHandle when=6816.703 H11Protocol.timeout_keep_alive_handler()>
Traceback (most recent call last):
File "G:\stable-diffusion-webui\venv\lib\site-packages\h11_state.py", line 249, in _fire_event_triggered_transitions
new_state = EVENT_TRIGGERED_TRANSITIONS[role][state][event_type]
KeyError: <class 'h11._events.ConnectionClosed'>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Program Files\Python310\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "G:\stable-diffusion-webui\venv\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 363, in timeout_keep_alive_handler
self.conn.send(event)
File "G:\stable-diffusion-webui\venv\lib\site-packages\h11_connection.py", line 468, in send
data_list = self.send_with_data_passthrough(event)
File "G:\stable-diffusion-webui\venv\lib\site-packages\h11_connection.py", line 493, in send_with_data_passthrough
self._process_event(self.our_role, event)
File "G:\stable-diffusion-webui\venv\lib\site-packages\h11_connection.py", line 242, in _process_event
self._cstate.process_event(role, type(event), server_switch_event)
File "G:\stable-diffusion-webui\venv\lib\site-packages\h11_state.py", line 238, in process_event
self._fire_event_triggered_transitions(role, event_type)
File "G:\stable-diffusion-webui\venv\lib\site-packages\h11_state.py", line 251, in _fire_event_triggered_transitions
raise LocalProtocolError(
h11._util.LocalProtocolError: can't handle event type ConnectionClosed when role=SERVER and state=SEND_RESPONSE
Civitai Helper: Write model webui info to file: G:\stable-diffusion-webui\models\Stable-diffusion\SDXL\sd_xl_refiner_1.0_0.9vae.json
Civitai Helper: Downloading model image.
Civitai Helper: Checking preview image for model: G:\stable-diffusion-webui\models\Stable-diffusion\SDXL\sd_xl_refiner_1.0_0.9vae.safetensors
Civitai Helper: Existing model image found. Skipping.
Civitai Helper: Creating model info for: animagineXL_v10.safetensors
*** API error: POST: http://127.0.0.1:7860/api/predict {'error': 'LocalProtocolError', 'detail': '', 'body': '', 'errors': "Can't send data when our state is ERROR"}
Traceback (most recent call last):
File "G:\stable-diffusion-webui\venv\lib\site-packages\starlette\middleware\errors.py", line 162, in call
await self.app(scope, receive, _send)
File "G:\stable-diffusion-webui\venv\lib\site-packages\starlette\middleware\base.py", line 109, in call
await response(scope, receive, send)
File "G:\stable-diffusion-webui\venv\lib\site-packages\starlette\responses.py", line 270, in call
async with anyio.create_task_group() as task_group:
File "G:\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 597, in aexit
raise exceptions[0]
File "G:\stable-diffusion-webui\venv\lib\site-packages\starlette\responses.py", line 273, in wrap
await func()
File "G:\stable-diffusion-webui\venv\lib\site-packages\starlette\middleware\base.py", line 134, in stream_response
return await super().stream_response(send)
File "G:\stable-diffusion-webui\venv\lib\site-packages\starlette\responses.py", line 255, in stream_response
await send(
File "G:\stable-diffusion-webui\venv\lib\site-packages\starlette\middleware\errors.py", line 159, in _send
await send(message)
File "G:\stable-diffusion-webui\venv\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 490, in send
output = self.conn.send(event=response)
File "G:\stable-diffusion-webui\venv\lib\site-packages\h11_connection.py", line 468, in send
data_list = self.send_with_data_passthrough(event)
File "G:\stable-diffusion-webui\venv\lib\site-packages\h11_connection.py", line 483, in send_with_data_passthrough
raise LocalProtocolError("Can't send data when our state is ERROR")
h11._util.LocalProtocolError: Can't send data when our state is ERROR


ERROR: Exception in ASGI application
Traceback (most recent call last):
File "G:\stable-diffusion-webui\venv\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 408, in run_asgi
result = await app( # type: ignore[func-returns-value]
File "G:\stable-diffusion-webui\venv\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 84, in call
return await self.app(scope, receive, send)
File "G:\stable-diffusion-webui\venv\lib\site-packages\fastapi\applications.py", line 273, in call
await super().call(scope, receive, send)
File "G:\stable-diffusion-webui\venv\lib\site-packages\starlette\applications.py", line 122, in call
await self.middleware_stack(scope, receive, send)
File "G:\stable-diffusion-webui\venv\lib\site-packages\starlette\middleware\errors.py", line 184, in call
raise exc
File "G:\stable-diffusion-webui\venv\lib\site-packages\starlette\middleware\errors.py", line 162, in call
await self.app(scope, receive, _send)
File "G:\stable-diffusion-webui\venv\lib\site-packages\starlette\middleware\base.py", line 109, in call
await response(scope, receive, send)
File "G:\stable-diffusion-webui\venv\lib\site-packages\starlette\responses.py", line 270, in call
async with anyio.create_task_group() as task_group:
File "G:\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 597, in aexit
raise exceptions[0]
File "G:\stable-diffusion-webui\venv\lib\site-packages\starlette\responses.py", line 273, in wrap
await func()
File "G:\stable-diffusion-webui\venv\lib\site-packages\starlette\middleware\base.py", line 134, in stream_response
return await super().stream_response(send)
File "G:\stable-diffusion-webui\venv\lib\site-packages\starlette\responses.py", line 255, in stream_response
await send(
File "G:\stable-diffusion-webui\venv\lib\site-packages\starlette\middleware\errors.py", line 159, in _send
await send(message)
File "G:\stable-diffusion-webui\venv\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 490, in send
output = self.conn.send(event=response)
File "G:\stable-diffusion-webui\venv\lib\site-packages\h11_connection.py", line 468, in send
data_list = self.send_with_data_passthrough(event)
File "G:\stable-diffusion-webui\venv\lib\site-packages\h11_connection.py", line 483, in send_with_data_passthrough
raise LocalProtocolError("Can't send data when our state is ERROR")
h11._util.LocalProtocolError: Can't send data when our state is ERROR
'AsyncRequest' object has no attribute '_json_response_data'

Suggestion: Adding a Snippet of Information to help View Additional (hidden) Loras

Have you read document? Y

Have you checked console log window's msg? Y

Describe Issue:

I was going crazy trying to figure out why only a handful of my LORAs were showing up in the interface.
I found out to see them you need to check a box under:

Settings\Extra Networks\ Always show all networks on the Lora page (otherwise, those detected as for incompatible version of Stable Diffusion will be hidden)

Perhaps just adding a note on the main install page here as well as within the program would save a lot of people reporting incorrect issues. I realize this is probably meant to prevent ones that are marked incompatible from being used, but it’s also hiding ones that are still working.

Scanning hangs on model and doesnt complete since latest update

Scanning models hangs on first model with error in log file as below

Civitai Helper: Existing model image found. Skipping.
Civitai Helper: Creating model info for: limitlessvisionxl_v1.safetensors
Civitai Helper: Using SD Webui SHA256
ERROR:asyncio:Exception in callback H11Protocol.timeout_keep_alive_handler()
handle: <TimerHandle when=83465.812 H11Protocol.timeout_keep_alive_handler()>
Traceback (most recent call last):
File "C:\Users\myuser\SD Nov 2023\stable-diffusion-webui\venv\lib\site-packages\h11_state.py", line 249, in _fire_event_triggered_transitions
new_state = EVENT_TRIGGERED_TRANSITIONS[role][state][event_type]
KeyError: <class 'h11._events.ConnectionClosed'>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\myuser\AppData\Local\Programs\Python\Python310\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "C:\Users\myuser\SD Nov 2023\stable-diffusion-webui\venv\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 363, in timeout_keep_alive_handler
self.conn.send(event)
File "C:\Users\myuser\SD Nov 2023\stable-diffusion-webui\venv\lib\site-packages\h11_connection.py", line 468, in send
data_list = self.send_with_data_passthrough(event)
File "C:\Users\myuser\SD Nov 2023\stable-diffusion-webui\venv\lib\site-packages\h11_connection.py", line 493, in send_with_data_passthrough
self._process_event(self.our_role, event)
File "C:\Users\myuser\SD Nov 2023\stable-diffusion-webui\venv\lib\site-packages\h11_connection.py", line 242, in _process_event
self._cstate.process_event(role, type(event), server_switch_event)
File "C:\Users\myuser\SD Nov 2023\stable-diffusion-webui\venv\lib\site-packages\h11_state.py", line 238, in process_event
self._fire_event_triggered_transitions(role, event_type)
File "C:\Users\myuser\SD Nov 2023\stable-diffusion-webui\venv\lib\site-packages\h11_state.py", line 251, in _fire_event_triggered_transitions
raise LocalProtocolError(
h11._util.LocalProtocolError: can't handle event type ConnectionClosed when role=SERVER and state=SEND_RESPONSE

TypeError: expected str, bytes or os.PathLike object, not tuple

Civitai Helper: Request version info from civitai
Civitai Helper: Fetching Parent Model Information
Civitai Helper: Request model info from civitai: 51057
Traceback (most recent call last):
File "F:\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 488, in run_predict
output = await app.get_blocks().process_api(
File "F:\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1431, in process_api
result = await self.call_function(
File "F:\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1103, in call_function
prediction = await anyio.to_thread.run_sync(
File "F:\AI\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "F:\AI\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 877, in run_sync_in_worker_thread
return await future
File "F:\AI\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 807, in run
result = context.run(func, *args)
File "F:\AI\stable-diffusion-webui\venv\lib\site-packages\gradio\utils.py", line 707, in wrapper
response = f(*args, **kwargs)
File "F:\AI\stable-diffusion-webui\extensions\Stable-Diffusion-Webui-Civitai-Helper\scripts\ch_lib\js_action_civitai.py", line 245, in dl_model_new_version
model.process_model_info(new_model_path, version_info, model_type)
File "F:\AI\stable-diffusion-webui\extensions\Stable-Diffusion-Webui-Civitai-Helper\scripts\ch_lib\model.py", line 165, in process_model_info
info_file, sd15_file = get_model_info_paths(model_path)
File "F:\AI\stable-diffusion-webui\extensions\Stable-Diffusion-Webui-Civitai-Helper\scripts\ch_lib\model.py", line 42, in get_model_info_paths
base, ext = os.path.splitext(model_path)
File "C:\Program Files\Python310\lib\ntpath.py", line 230, in splitext
p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not tuple

[BUG] Loss of information due to update

Thank you for the update. Just two issues, one major and the other is minor.

Major bug:
If you already have an existing info file that contains information, and it tries to update but cannot as the model have been removed from Civitai or the model never existed as you manually created the JSON. Instead of merging the data, it create a new JSON skeleton data and old data is lost. This is a major bug as models get removed all the time and one creates their one their own data. The data should imported from the current info file if it does not exist on Civitai. A merge would be nice even if the model exists on Civitai, but might not be worth the effort for 99% of the time. Apart from merging trigger words. But if, it does not exist just update the JSON structure.

I lost a lot of data with this. I should've backed up. A mistake on my behalf.

Minor Issue::
For a model that does not exist on Civitai, if the model.name property is empty it should contain the filename of the model.

{
    "id": "",
    "modelId": "",
    "name": "",
    "trainedWords": [],
    "baseModel": "Unknown",
    "description": "",
    "model": {
        "name": "7th_Anime_v3_A",
        "type": "ckp",
        "nsfw": "",
        "poi": "",
        "description": "",
        "tags": []
    },
    "files": [
        {
            "name": "7th_Anime_v3_A.safetensors", <-------- FILENAME
            "sizeKB": 4165133,
            "type": "Model",
            "hashes": {
                "AutoV2": "c330a60ddc",
                "SHA256": "c330a60ddcb49c61109dbd7c28cf326733dadb77984c6e8d162bdc200a05df9e"
            }
        }
    ],
    "downloadUrl": "",
    "extensions": {
        "sd_civitai_helper": {
            "version": "1.7.2"
        }
    }
}

Finally not an issue. I thought you might end up merging the data into the json file and thus not needing the info file. So it would be something like:

{
    "description": "",
    "notes": "",
    "sd version": "Unknown",
    "extensions": {
        "sd_civitai_helper": {
            "version": "1.7.2"
            "data": {
                  ... contains the actual JSON data of the model
             }
        }
    }
}

Incompatible with SD.Next since 0da8c70

Describe Issue

Commit 0da8c70 introduced modules.cache import which does not exist in SD.Next.
Instead same functionality is provided by the hashes module.
import modules.hashes as sha256_cache should fix it, but hashes is already imported anyway.

Please support new SD.Next version

i try to install into the SD.Next new version
but it can't work, please support new SD.Next version

18:20:35-333770 INFO     Extension: script='extensions-builtin\sd-webui-controlnet\scripts\hook.py' Warning: ControlNet
                         failed to load SGM - will use LDM instead.
18:20:35-569659 ERROR    Module load: extensions\Stable-Diffusion-Webui-Civitai-Helper\scripts\civitai_helper.py:
                         InvalidVersion
┌───────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────┐
│ C:\AI\automatic\modules\script_loading.py:21 in load_module                                                         │
│                                                                                                                     │
│   20 │   │   │   with contextlib.redirect_stdout(io.StringIO()) as stdout:                                          │
│ > 21 │   │   │   │   module_spec.loader.exec_module(module)                                                         │
│   22 │   │   │   setup_logging() # reset since scripts can hijaack logging                                          │
│ in exec_module:883                                                                                                  │
│ in _call_with_frames_removed:241                                                                                    │
│                                                                                                                     │
│ C:\AI\automatic\extensions\Stable-Diffusion-Webui-Civitai-Helper\scripts\civitai_helper.py:30 in <module>           │
│                                                                                                                     │
│    29 │   "open_url_button": False,                                                                                 │
│ >  30 │   "add_trigger_words_button": False,                                                                        │
│    31 │   "add_preview_prompt_button": False,                                                                       │
│                                                                                                                     │
│ C:\AI\automatic\extensions\Stable-Diffusion-Webui-Civitai-Helper\scripts\ch_lib\util.py:349 in newer_version        │
│                                                                                                                     │
│   348 │   if allow_equal:                                                                                           │
│ > 349 │   │   return parse_version(ver1) >= parse_version(ver2)                                                     │
│   350                                                                                                               │
│                                                                                                                     │
│ C:\AI\automatic\venv\lib\site-packages\packaging\version.py:54 in parse                                             │
│                                                                                                                     │
│    53 │   """                                                                                                       │
│ >  54 │   return Version(version)                                                                                   │
│    55                                                                                                               │
│                                                                                                                     │
│ C:\AI\automatic\venv\lib\site-packages\packaging\version.py:200 in __init__                                         │
│                                                                                                                     │
│   199 │   │   if not match:                                                                                         │
│ > 200 │   │   │   raise InvalidVersion(f"Invalid version: '{version}'")                                             │
│   201                                                                                                               │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
InvalidVersion: Invalid version: 'OK-16-gb5c05873'
18:20:35-655359 INFO     Extensions time: 0.92 { Lora=0.21 sd-webui-agent-scheduler=0.11 sd-webui-controlnet=0.19
                         stable-diffusion-webui-images-browser=0.12 stable-diffusion-webui-rembg=0.05
                         Stable-Diffusion-Webui-Civitai-Helper=0.14 }
18:20:35-749277 INFO     Load UI theme: name="black-teal" style=Auto base=style.css
18:20:37-689071 INFO     Local URL: http://127.0.0.1:7860/
18:20:37-689071 INFO     Initializing middleware
18:20:38-217307 INFO     [AgentScheduler] Task queue is empty
18:20:38-217307 INFO     [AgentScheduler] Registering APIs
18:20:38-339933 INFO     Startup time: 154.10 { samplers=150.48 extensions=0.92 ui-extra-networks=0.18 ui-txt2img=0.05
                         ui-img2img=0.09 ui-settings=0.09 ui-extensions=1.27 ui-defaults=0.06 launch=0.19
                         app-started=0.64 }
18:20:40-835002 INFO     MOTD: N/A
18:20:43-896223 INFO     Browser session: client=127.0.0.1 agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0)
                         Gecko/20100101 Firefox/119.0

After the update, an error message is displayed, indicating that the CIVIT server cannot be connected to obtain image information about the model

File "E:\sd-webui-aki-v4.4\extensions\Stable-Diffusion-Webui-Civitai-Helper\scripts\ch_lib\downloader.py", line 23, in request_get
request = requests.get(
File "E:\sd-webui-aki-v4.4\python\lib\site-packages\requests\api.py", line 76, in get
return request('get', url, params=params, **kwargs)
File "E:\sd-webui-aki-v4.4\python\lib\site-packages\requests\api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "E:\sd-webui-aki-v4.4\python\lib\site-packages\requests\sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "E:\sd-webui-aki-v4.4\python\lib\site-packages\requests\sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "E:\sd-webui-aki-v4.4\python\lib\site-packages\requests\adapters.py", line 498, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(10054, '远程主机强迫关闭了一个现有的连接。', None, 10054, None))

Is it a setup problem? Or the environment? I can only use the reduced version, but it is a little too troublesome. Is there any other way to solve this error?

[Feature]增加civitai元数据示例图图片生成信息功能,并将生成信息按照civitai.info的格式保存到meta中

civitai网站元数据中,有些示例图没有meta信息,
例如这个lora:Cute01-000002示例图
civitai.info中没有meta信息,但是将图片导入png_info中可以读取到图片生成信息
希望可以增加为civitai元数据示例图图片生成信息功能,并将图片生成信息按照civitai.info的格式保存到meta中
思路是:使用requests.get函数获取示例图片数据,然后使用modules.extras.run_pnginfo函数读取图片生成信息,再按照civitai.info中的meta格式保存到civitai.info元数据中

Can't connect to Civitai after setting proxy | 在配置了代理后依然无法连接至civitai

由于civitai在**境内无法访问,我在我自己的局域网内设立了代理服务,提供http和socks5代理,并且在webui中设置了代理地址(如图所示)
Since civitai is not accessible within China, I set up a proxy service on my own LAN to provide http and socks5 proxies, and set up the proxy address in the webui (as shown in the picture)

image
image

但是我在civitai helper中进行任何需要访问civitai的操作都会报以下错误,同时我并没有在代理服务的后台发现任何代理请求
But any action I do in the civitai helper that requires access to civitai reports the following error, and I don't find any proxy requests in the backend of the proxy service

Traceback (most recent call last):
  File "/home/wall/stable-diffusion-webui/venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 711, in urlopen
    self._prepare_proxy(conn)
  File "/home/wall/stable-diffusion-webui/venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1007, in _prepare_proxy
    conn.connect()
  File "/home/wall/stable-diffusion-webui/venv/lib/python3.10/site-packages/urllib3/connection.py", line 419, in connect
    self.sock = ssl_wrap_socket(
  File "/home/wall/stable-diffusion-webui/venv/lib/python3.10/site-packages/urllib3/util/ssl_.py", line 449, in ssl_wrap_socket
    ssl_sock = _ssl_wrap_socket_impl(
  File "/home/wall/stable-diffusion-webui/venv/lib/python3.10/site-packages/urllib3/util/ssl_.py", line 493, in _ssl_wrap_socket_impl
    return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
  File "/usr/lib/python3.10/ssl.py", line 513, in wrap_socket
    return self.sslsocket_class._create(
  File "/usr/lib/python3.10/ssl.py", line 1071, in _create
    self.do_handshake()
  File "/usr/lib/python3.10/ssl.py", line 1342, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLEOFError: [SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1007)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/wall/stable-diffusion-webui/venv/lib/python3.10/site-packages/requests/adapters.py", line 486, in send
    resp = conn.urlopen(
  File "/home/wall/stable-diffusion-webui/venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 798, in urlopen
    retries = retries.increment(
  File "/home/wall/stable-diffusion-webui/venv/lib/python3.10/site-packages/urllib3/util/retry.py", line 592, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='civitai.com', port=443): Max retries exceeded with url: /api/v1/models/5285 (Caused by SSLError(SSLEOFError(8, '[SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1007)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/wall/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/routes.py", line 488, in run_predict
    output = await app.get_blocks().process_api(
  File "/home/wall/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1431, in process_api
    result = await self.call_function(
  File "/home/wall/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1103, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "/home/wall/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "/home/wall/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "/home/wall/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "/home/wall/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/utils.py", line 707, in wrapper
    response = f(*args, **kwargs)
  File "/home/wall/stable-diffusion-webui/extensions/Stable-Diffusion-Webui-Civitai-Helper/scripts/ch_lib/model_action_civitai.py", line 287, in check_models_new_version_to_md
    new_versions = civitai.check_models_new_version_by_model_types(model_types, 0.2)
  File "/home/wall/stable-diffusion-webui/extensions/Stable-Diffusion-Webui-Civitai-Helper/scripts/ch_lib/civitai.py", line 649, in check_models_new_version_by_model_types
    version = check_single_model_new_version(root, filename, model_type, delay)
  File "/home/wall/stable-diffusion-webui/extensions/Stable-Diffusion-Webui-Civitai-Helper/scripts/ch_lib/civitai.py", line 589, in check_single_model_new_version
    request = check_model_new_version_by_path(item, delay)
  File "/home/wall/stable-diffusion-webui/extensions/Stable-Diffusion-Webui-Civitai-Helper/scripts/ch_lib/civitai.py", line 537, in check_model_new_version_by_path
    model_info = get_model_info_by_id(model_id)
  File "/home/wall/stable-diffusion-webui/extensions/Stable-Diffusion-Webui-Civitai-Helper/scripts/ch_lib/civitai.py", line 146, in get_model_info_by_id
    content = civitai_get(f'{URLS["modelId"]}{model_id}')
  File "/home/wall/stable-diffusion-webui/extensions/Stable-Diffusion-Webui-Civitai-Helper/scripts/ch_lib/civitai.py", line 36, in civitai_get
    request = downloader.request_get(
  File "/home/wall/stable-diffusion-webui/extensions/Stable-Diffusion-Webui-Civitai-Helper/scripts/ch_lib/downloader.py", line 23, in request_get
    request = requests.get(
  File "/home/wall/stable-diffusion-webui/venv/lib/python3.10/site-packages/requests/api.py", line 73, in get
    return request("get", url, params=params, **kwargs)
  File "/home/wall/stable-diffusion-webui/venv/lib/python3.10/site-packages/requests/api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/wall/stable-diffusion-webui/venv/lib/python3.10/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/wall/stable-diffusion-webui/venv/lib/python3.10/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
  File "/home/wall/stable-diffusion-webui/venv/lib/python3.10/site-packages/requests/adapters.py", line 517, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='civitai.com', port=443): Max retries exceeded with url: /api/v1/models/5285 (Caused by SSLError(SSLEOFError(8, '[SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1007)')))

Not pulling in keywords or any other information from Civit any more

Have you read document?

Yes

Have you checked console log window's msg?

Says scanned 223 models

Describe Issue

Download some Loras from Civit. Some of these have been on civit for many weeks now, they're not new.
Tell CivitAiHelper to scan
Scan complete, console looks like it is pulling in preview images
Restart WebUI (console and browser)
Go to Loras
Loras have thumbnails thanks to Helper
But no other information. No "about", no keywords.

Updated helper just now, and tried scan again.

Checked console, it says " Model metadata not needed" for the new Loras. But there is no metadata showing in the Lora tab in WebUI, keywords and info are blank.

Helper IS pulling in model/lora URL, and if I look at the raw .info file, I can see a description and keywords in the .info. But it's not reading it into the WebUI for some reason.

Same with Checkpoints. I just downloaded epicphotogasm_lastUnicorn and ran the helper.
It has a thumbnail and goes to the correct URL.
But there is no description, no info.

WebUI issue or CivitAIHelper issue?
Please help me to know.
I doubt WebUI issue as it used to work fine, and I have not updated WebUI, only Helper. So something must have changed in the Helper.

Screenshot for UI issue

Console log's msg or screenshot for function issue

updating is broken

I have like 200 Loras installed. When I try to "Check models' new version", it is enough that one of them fails with:

requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='civitai.com', port=443): Read timed out. (read timeout=5)

and the whole update is broken and the results are lost. This should either retry connections, or present to me the partial results, or use another best effort approach. Simply failing and displaying (Error) is not enough.

The only workaround I can think of right now is moving most loras out of my setup, run the update for the partial set, and maybe it will succeed.

Another thing is that calling Civitai API 200 times just to see if anything was updated seems cumbersome. First of all, we could assume that each lora is only updated once a day - if it has been checked less than a day ago, then skip it. This would resolve my issue btw. Then, a bulk query should be possible to API, asking for the most recent versions of each lora in the set. If their API doesn't allow that (and they refuse to improve it), then caching such results would be prudent - just have a microservice query for top 5000 loras daily, and then Civitai Helper would fetch that result instead of querying Civitai - they benefit from this too as only get their API asked 5000 times daily, instead of all users asking for all loras multiple times.

Finally, as a side remark, just checking the sha hash of a model isn't the best method to identify it. I use https://github.com/arenasys/stable-diffusion-webui-model-toolkit to prune checkpoint models from unnecessary stuff that makes them easier to squeeze in my VRAM. And now if I used Civitai Helper to find their updates, it would yield errors because the hash is now different. Either Civitai Helper should somehow know what checksum of a model was before pruning, or calculate the checksum of the part that is never pruned, or use the abovementioned microservice to translate various hashes into their normalised form.

I get this error message at startup

*** Error loading script: civitai_helper.py
Traceback (most recent call last):
File "F:\StabilityMatrix-win-x64\Data\Packages\Stable Diffusion WebUI\modules\scripts.py", line 382, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "F:\StabilityMatrix-win-x64\Data\Packages\Stable Diffusion WebUI\modules\script_loading.py", line 10, in load_module
module_spec.loader.exec_module(module)
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "F:\StabilityMatrix-win-x64\Data\Packages\Stable Diffusion WebUI\extensions\Stable-Diffusion-Webui-Civitai-Helper\scripts\civitai_helper.py", line 31, in
"add_trigger_words_button": util.newer_version(util.webui_version(), '1.5.0', allow_equal=True),
File "F:\StabilityMatrix-win-x64\Data\Packages\Stable Diffusion WebUI\extensions\Stable-Diffusion-Webui-Civitai-Helper\scripts\ch_lib\util.py", line 253, in newer_version
return parse_version(ver1) >= parse_version(ver2)
File "F:\StabilityMatrix-win-x64\Data\Packages\Stable Diffusion WebUI\venv\lib\site-packages\packaging\version.py", line 52, in parse
return Version(version)
File "F:\StabilityMatrix-win-x64\Data\Packages\Stable Diffusion WebUI\venv\lib\site-packages\packaging\version.py", line 196, in init
match = self._regex.search(version)
TypeError: expected string or bytes-like object


I am a layman so I don't know the details, but it may be an inherent problem with using StabilityMatrix.

Feature Request: Black list

I have a lot of custom LoRAs, or ones not from CivitAI, so is there a way that you could possibly add a blacklist file that the extension ignores LoRAs/Models/TI's from, so it doesn't even try to look for them? Possibly a text file... it would make the "Get Model Info from Civitai by URL" function a lot easier if I didn't have to go through my list of over 400 LoRAs that aren't and will never be on CivitAI.

Just a thought. Thanks for the great work!

[BUG] Model scan fails: asynchio/h11/uvicorn

RuntimeError: dictionary changed size during iteration
提示:Python 运行时抛出了一个异常。请检查疑难解答页面。
Civitai Helper: Start scan_model
Civitai Helper: Scanning path: H:\sd-webui-aki-v4.4\models\Lora
Civitai Helper: Model metadata not needed for 64x64-10.safetensors
Civitai Helper: Downloading model image.
Civitai Helper: Checking preview image for model: H:\sd-webui-aki-v4.4\models\Lora\64x64-10.safetensors
Civitai Helper: Existing model image found. Skipping.
Civitai Helper: Model metadata not needed for abtmv0.22.safetensors
Civitai Helper: Downloading model image.
Civitai Helper: Checking preview image for model: H:\sd-webui-aki-v4.4\models\Lora\abtmv0.22.safetensors
Civitai Helper: Existing model image found. Skipping.
Civitai Helper: Model metadata not needed for anmi-ver3.safetensors
Civitai Helper: Downloading model image.
Civitai Helper: Checking preview image for model: H:\sd-webui-aki-v4.4\models\Lora\anmi-ver3.safetensors
Civitai Helper: Existing model image found. Skipping.
Civitai Helper: Model metadata not needed for anmi.safetensors
Civitai Helper: Downloading model image.
Civitai Helper: Checking preview image for model: H:\sd-webui-aki-v4.4\models\Lora\anmi.safetensors
Civitai Helper: This image is NSFW: Mature
Civitai Helper: Start downloading from: https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/8227cbf6-2da2-4dbe-bc18-bbc43e0d3b46/width=2048/978232.jpeg
Civitai Helper: Target file path: H:\sd-webui-aki-v4.4\models\Lora\anmi.preview.png
Civitai Helper: File size: 759081
Civitai Helper: Downloading to temp file: H:\sd-webui-aki-v4.4\models\Lora\anmi.preview.png.downloading
Civitai Helper: File Downloaded to: H:\sd-webui-aki-v4.4\models\Lora\anmi.preview.png
Civitai Helper: Creating model info for: gbaportrait.safetensors
Civitai Helper: Using SD Webui SHA256
Calculating sha256 for H:\sd-webui-aki-v4.4\models\Lora\gbaportrait.safetensors: ddf667109c5c0dd91f490207bd84b48594bfaebeab84cf2d7b6e19447f285f76
Civitai Helper: Request model info from civitai
ERROR:asyncio:Exception in callback H11Protocol.timeout_keep_alive_handler()
handle: <TimerHandle when=22788.0 H11Protocol.timeout_keep_alive_handler()>
Traceback (most recent call last):
  File "H:\sd-webui-aki-v4.4\venv\lib\site-packages\h11\_state.py", line 249, in _fire_event_triggered_transitions
    new_state = EVENT_TRIGGERED_TRANSITIONS[role][state][event_type]
KeyError: <class 'h11._events.ConnectionClosed'>
提示:Python 运行时抛出了一个异常。请检查疑难解答页面。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\PC\AppData\Local\Programs\Python\Python310\lib\asyncio\events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "H:\sd-webui-aki-v4.4\venv\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 363, in timeout_keep_alive_handler
    self.conn.send(event)
  File "H:\sd-webui-aki-v4.4\venv\lib\site-packages\h11\_connection.py", line 468, in send
    data_list = self.send_with_data_passthrough(event)
  File "H:\sd-webui-aki-v4.4\venv\lib\site-packages\h11\_connection.py", line 493, in send_with_data_passthrough
    self._process_event(self.our_role, event)
  File "H:\sd-webui-aki-v4.4\venv\lib\site-packages\h11\_connection.py", line 242, in _process_event
    self._cstate.process_event(role, type(event), server_switch_event)
  File "H:\sd-webui-aki-v4.4\venv\lib\site-packages\h11\_state.py", line 238, in process_event
    self._fire_event_triggered_transitions(role, event_type)
  File "H:\sd-webui-aki-v4.4\venv\lib\site-packages\h11\_state.py", line 251, in _fire_event_triggered_transitions
    raise LocalProtocolError(
h11._util.LocalProtocolError: can't handle event type ConnectionClosed when role=SERVER and state=SEND_RESPONSE
Civitai Helper: Fetching Parent Model Information
Civitai Helper: Request model info from civitai: 184199
Civitai Helper: Write model civitai info to file: H:\sd-webui-aki-v4.4\models\Lora\gbaportrait.civitai.info
Civitai Helper: Write model SD webui info to file: H:\sd-webui-aki-v4.4\models\Lora\gbaportrait.json
Civitai Helper: Write model webui info to file: H:\sd-webui-aki-v4.4\models\Lora\gbaportrait.json
Civitai Helper: delay: 0.2 second
Civitai Helper: Downloading model image.
Civitai Helper: Checking preview image for model: H:\sd-webui-aki-v4.4\models\Lora\gbaportrait.safetensors
Civitai Helper: This image is NSFW: Soft
Civitai Helper: Start downloading from: https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/cc6ccdad-6869-4e52-ba22-c3648f385ea0/width=1024/3297499.jpeg
Civitai Helper: Target file path: H:\sd-webui-aki-v4.4\models\Lora\gbaportrait.preview.png
Civitai Helper: File size: 175760
Civitai Helper: Downloading to temp file: H:\sd-webui-aki-v4.4\models\Lora\gbaportrait.preview.png.downloading
*** API error: POST: http://127.0.0.1:7860/api/predict {'error': 'LocalProtocolError', 'detail': '', 'body': '', 'errors': "Can't send data when our state is ERROR"}
    Traceback (most recent call last):
      File "H:\sd-webui-aki-v4.4\venv\lib\site-packages\starlette\middleware\errors.py", line 162, in __call__
        await self.app(scope, receive, _send)
      File "H:\sd-webui-aki-v4.4\venv\lib\site-packages\starlette\middleware\base.py", line 109, in __call__
        await response(scope, receive, send)
      File "H:\sd-webui-aki-v4.4\venv\lib\site-packages\starlette\responses.py", line 270, in __call__
        async with anyio.create_task_group() as task_group:
      File "H:\sd-webui-aki-v4.4\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 597, in __aexit__
        raise exceptions[0]
      File "H:\sd-webui-aki-v4.4\venv\lib\site-packages\starlette\responses.py", line 273, in wrap
        await func()
      File "H:\sd-webui-aki-v4.4\venv\lib\site-packages\starlette\middleware\base.py", line 134, in stream_response
        return await super().stream_response(send)
      File "H:\sd-webui-aki-v4.4\venv\lib\site-packages\starlette\responses.py", line 255, in stream_response
        await send(
      File "H:\sd-webui-aki-v4.4\venv\lib\site-packages\starlette\middleware\errors.py", line 159, in _send
        await send(message)
      File "H:\sd-webui-aki-v4.4\venv\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 490, in send
        output = self.conn.send(event=response)
      File "H:\sd-webui-aki-v4.4\venv\lib\site-packages\h11\_connection.py", line 468, in send
        data_list = self.send_with_data_passthrough(event)
      File "H:\sd-webui-aki-v4.4\venv\lib\site-packages\h11\_connection.py", line 483, in send_with_data_passthrough
        raise LocalProtocolError("Can't send data when our state is ERROR")
    h11._util.LocalProtocolError: Can't send data when our state is ERROR

---
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "H:\sd-webui-aki-v4.4\venv\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 408, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "H:\sd-webui-aki-v4.4\venv\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 84, in __call__
    return await self.app(scope, receive, send)
  File "H:\sd-webui-aki-v4.4\venv\lib\site-packages\fastapi\applications.py", line 273, in __call__
    await super().__call__(scope, receive, send)
  File "H:\sd-webui-aki-v4.4\venv\lib\site-packages\starlette\applications.py", line 122, in __call__
    await self.middleware_stack(scope, receive, send)
  File "H:\sd-webui-aki-v4.4\venv\lib\site-packages\starlette\middleware\errors.py", line 184, in __call__
    raise exc
  File "H:\sd-webui-aki-v4.4\venv\lib\site-packages\starlette\middleware\errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "H:\sd-webui-aki-v4.4\venv\lib\site-packages\starlette\middleware\base.py", line 109, in __call__
    await response(scope, receive, send)
  File "H:\sd-webui-aki-v4.4\venv\lib\site-packages\starlette\responses.py", line 270, in __call__
    async with anyio.create_task_group() as task_group:
  File "H:\sd-webui-aki-v4.4\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 597, in __aexit__
    raise exceptions[0]
  File "H:\sd-webui-aki-v4.4\venv\lib\site-packages\starlette\responses.py", line 273, in wrap
    await func()
  File "H:\sd-webui-aki-v4.4\venv\lib\site-packages\starlette\middleware\base.py", line 134, in stream_response
    return await super().stream_response(send)
  File "H:\sd-webui-aki-v4.4\venv\lib\site-packages\starlette\responses.py", line 255, in stream_response
    await send(
  File "H:\sd-webui-aki-v4.4\venv\lib\site-packages\starlette\middleware\errors.py", line 159, in _send
    await send(message)
  File "H:\sd-webui-aki-v4.4\venv\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 490, in send
    output = self.conn.send(event=response)
  File "H:\sd-webui-aki-v4.4\venv\lib\site-packages\h11\_connection.py", line 468, in send
    data_list = self.send_with_data_passthrough(event)
  File "H:\sd-webui-aki-v4.4\venv\lib\site-packages\h11\_connection.py", line 483, in send_with_data_passthrough
    raise LocalProtocolError("Can't send data when our state is ERROR")
h11._util.LocalProtocolError: Can't send data when our state is ERROR
'AsyncRequest' object has no attribute '_json_response_data'

此报错会伴随着一个为下载完成的xxx.preview.png.downloading文件,可以通过更换vpn节点来影响下载到第几个的时候触发
在控制台可以看到一个下载种的读条卡在中间或100%的显示。

This error will be accompanied by a completed for download XXX. Preview. PNG. Downloading files, can be downloaded by changing the VPN nodes to influence by which a trigger

In the console you can see a download type of read bar stuck in the middle or 100% display.

希望能加入一个强制终止当前进程的按钮,这样卡死可以省去重启的过程

Want to add a button to force the current process to terminate, so that the deadlock can save the restart process

Something broke with the update a few versions ago

2023-10-29T12:08:40.257238787Z Civitai Helper: Checking preview image for model: /stable-diffusion-webui/models/Stable-diffusion/Photorealistic/ethernaldope_v10.safetensors
2023-10-29T12:08:40.257427129Z Civitai Helper: This image is NSFW: Mature
2023-10-29T12:08:40.561901785Z Civitai Helper: Start downloading from: https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/8bf2a1cb-f27d-418c-ab1f-3a211d43717c/width=1024/2986612.jpeg
2023-10-29T12:08:40.561927235Z Civitai Helper: Target file path: /stable-diffusion-webui/models/Stable-diffusion/Photorealistic/ethernaldope_v10.preview.png
2023-10-29T12:08:40.561929064Z Civitai Helper: File size: 137730
2023-10-29T12:08:40.561930645Z Civitai Helper: Downloading to temp file: /stable-diffusion-webui/models/Stable-diffusion/Photorealistic/ethernaldope_v10.preview.png.downloading
2023-10-29T12:08:40.561932307Z Civitai Helper: Resuming partially downloaded file from progress: 137730
2023-10-29T12:08:40.652744677Z Civitai Helper: GET Request failed with error code:
2023-10-29T12:08:40.652756519Z    416: Requested Range Not Satisfiable
2023-10-29T12:08:40.652758159Z Civitai Helper: Retrying
2023-10-29T12:08:40.734648572Z Civitai Helper: GET Request failed with error code:
2023-10-29T12:08:40.734661495Z    416: Requested Range Not Satisfiable
2023-10-29T12:08:40.734663166Z Civitai Helper: Retrying
2023-10-29T12:08:40.810681140Z Civitai Helper: GET Request failed with error code:
2023-10-29T12:08:40.810699554Z    416: Requested Range Not Satisfiable
2023-10-29T12:08:40.810701342Z Civitai Helper: Retrying
2023-10-29T12:08:40.882415724Z Civitai Helper: GET Request failed with error code:
2023-10-29T12:08:40.882427651Z    416: Requested Range Not Satisfiable

2023-10-29T12:08:40.886573856Z Civitai Helper: Model metadata not needed for epicrealism_naturalSinRC1VAE.safetensors
2023-10-29T12:08:40.886575404Z Civitai Helper: Downloading model image.
2023-10-29T12:08:40.886576823Z Civitai Helper: Checking preview image for model: /stable-diffusion-webui/models/Stable-diffusion/Photorealistic/epicrealism_naturalSinRC1VAE.safetensors
2023-10-29T12:08:41.124596232Z Civitai Helper: Start downloading from: https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/3822f91b-5f4e-4df6-8934-2a453f13b40e/width=960/2103034.jpeg
2023-10-29T12:08:41.124610054Z Civitai Helper: Target file path: /stable-diffusion-webui/models/Stable-diffusion/Photorealistic/epicrealism_naturalSinRC1VAE.preview.png
2023-10-29T12:08:41.124611851Z Civitai Helper: File size: 106983
2023-10-29T12:08:41.124613285Z Civitai Helper: Downloading to temp file: /stable-diffusion-webui/models/Stable-diffusion/Photorealistic/epicrealism_naturalSinRC1VAE.preview.png.downloading
2023-10-29T12:08:41.124614847Z Civitai Helper: Resuming partially downloaded file from progress: 106983
2023-10-29T12:08:41.203427659Z Civitai Helper: GET Request failed with error code:
2023-10-29T12:08:41.203440316Z    416: Range Not Satisfiable
2023-10-29T12:08:41.203442073Z Civitai Helper: Retrying
2023-10-29T12:08:41.274891957Z Civitai Helper: GET Request failed with error code:
2023-10-29T12:08:41.274915860Z    416: Range Not Satisfiable
2023-10-29T12:08:41.274917556Z Civitai Helper: Retrying
2023-10-29T12:08:41.353289468Z Civitai Helper: GET Request failed with error code:
2023-10-29T12:08:41.353300786Z    416: Range Not Satisfiable
2023-10-29T12:08:41.353302620Z Civitai Helper: Retrying
2023-10-29T12:08:41.424637269Z Civitai Helper: GET Request failed with error code:
2023-10-29T12:08:41.424649399Z    416: Range Not Satisfiable
2023-10-29T12:08:41.679650019Z Civitai Helper: Target file path: /stable-diffusion-webui/models/Stable-diffusion/Photorealistic/protogenInfinity_protogenInfinity.preview.png
2023-10-29T12:08:41.679651870Z Civitai Helper: File size: 98339
2023-10-29T12:08:41.679653531Z Civitai Helper: Downloading to temp file: /stable-diffusion-webui/models/Stable-diffusion/Photorealistic/protogenInfinity_protogenInfinity.preview.png.downloading
2023-10-29T12:08:41.679655132Z Civitai Helper: Resuming partially downloaded file from progress: 98339
2023-10-29T12:08:41.759944829Z Civitai Helper: GET Request failed with error code:
2023-10-29T12:08:41.759959044Z    416: Range Not Satisfiable
2023-10-29T12:08:41.759960819Z Civitai Helper: Retrying
2023-10-29T12:08:41.826163552Z Civitai Helper: GET Request failed with error code:
2023-10-29T12:08:41.826187581Z    416: Range Not Satisfiable
2023-10-29T12:08:41.826189267Z Civitai Helper: Retrying
2023-10-29T12:08:41.899455552Z Civitai Helper: GET Request failed with error code:
2023-10-29T12:08:41.899467411Z    416: Range Not Satisfiable
2023-10-29T12:08:41.899469047Z Civitai Helper: Retrying
2023-10-29T12:08:41.966184171Z Civitai Helper: GET Request failed with error code:
2023-10-29T12:08:41.966196358Z    416: Range Not Satisfiable

2023-10-29T12:08:41.970193122Z Civitai Helper: Checking preview image for model: /stable-diffusion-webui/models/Stable-diffusion/Photorealistic/protogenX53Photorealism_protogenX53.safetensors
2023-10-29T12:08:42.225351148Z Civitai Helper: Start downloading from: https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/6614bd63-e522-4826-27c5-5e93d335c000/width=3000/27601.jpeg
2023-10-29T12:08:42.225388738Z Civitai Helper: Target file path: /stable-diffusion-webui/models/Stable-diffusion/Photorealistic/protogenX53Photorealism_protogenX53.preview.png
2023-10-29T12:08:42.225494312Z Civitai Helper: File size: 1693215
2023-10-29T12:08:42.225501030Z Civitai Helper: Downloading to temp file: /stable-diffusion-webui/models/Stable-diffusion/Photorealistic/protogenX53Photorealism_protogenX53.preview.png.downloading
2023-10-29T12:08:42.225502908Z Civitai Helper: Resuming partially downloaded file from progress: 1431071
2023-10-29T12:08:42.622187819Z 
  0% 0.00/1.61M [00:00<?, ?iB/s]
 15% 256k/1.61M [00:00<00:00, 5.04MiB/s]

2023-10-29T12:08:42.629106272Z Civitai Helper: Creating model info for: test_1.safetensors
2023-10-29T12:08:42.629108374Z Civitai Helper: Use Memory Optimized SHA256
2023-10-29T12:08:47.626096164Z 2023-10-29 12:08:47 ERROR [asyncio] Exception in callback H11Protocol.timeout_keep_alive_handler()
2023-10-29T12:08:47.626110467Z handle: <TimerHandle when=680232.21970726 H11Protocol.timeout_keep_alive_handler()>
2023-10-29T12:08:47.626112604Z Traceback (most recent call last):
2023-10-29T12:08:47.626114150Z   File "/usr/local/lib/python3.10/site-packages/h11/_state.py", line 249, in _fire_event_triggered_transitions
2023-10-29T12:08:47.626115875Z     new_state = EVENT_TRIGGERED_TRANSITIONS[role][state][event_type]
2023-10-29T12:08:47.626117454Z KeyError: <class 'h11._events.ConnectionClosed'>
2023-10-29T12:08:47.626119038Z 
2023-10-29T12:08:47.626120434Z During handling of the above exception, another exception occurred:
2023-10-29T12:08:47.626121899Z 
2023-10-29T12:08:47.626123242Z Traceback (most recent call last):
2023-10-29T12:08:47.626124641Z   File "/usr/local/lib/python3.10/asyncio/events.py", line 80, in _run
2023-10-29T12:08:47.626126156Z     self._context.run(self._callback, *self._args)
2023-10-29T12:08:47.626127594Z   File "/usr/local/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 363, in timeout_keep_alive_handler
2023-10-29T12:08:47.626129214Z     self.conn.send(event)
2023-10-29T12:08:47.626130604Z   File "/usr/local/lib/python3.10/site-packages/h11/_connection.py", line 468, in send
2023-10-29T12:08:47.626132108Z     data_list = self.send_with_data_passthrough(event)
2023-10-29T12:08:47.626133596Z   File "/usr/local/lib/python3.10/site-packages/h11/_connection.py", line 493, in send_with_data_passthrough
2023-10-29T12:08:47.626135127Z     self._process_event(self.our_role, event)
2023-10-29T12:08:47.626136535Z   File "/usr/local/lib/python3.10/site-packages/h11/_connection.py", line 242, in _process_event
2023-10-29T12:08:47.626138033Z     self._cstate.process_event(role, type(event), server_switch_event)
2023-10-29T12:08:47.626139491Z   File "/usr/local/lib/python3.10/site-packages/h11/_state.py", line 238, in process_event
2023-10-29T12:08:47.626141030Z     self._fire_event_triggered_transitions(role, event_type)
2023-10-29T12:08:47.626142487Z   File "/usr/local/lib/python3.10/site-packages/h11/_state.py", line 251, in _fire_event_triggered_transitions
2023-10-29T12:08:47.626144002Z     raise LocalProtocolError(
2023-10-29T12:08:47.626145446Z h11._util.LocalProtocolError: can't handle event type ConnectionClosed when role=SERVER and state=SEND_RESPONSE

2023-10-29T12:08:50.047813800Z Civitai Helper: Downloading to temp file: /stable-diffusion-webui/models/Lora/test_1.preview.png.downloading
2023-10-29T12:08:50.143231166Z 
  0% 0.00/114k [00:00<?, ?iB/s]*** API error: POST: http://localhost:7860/api/predict {'error': 'LocalProtocolError', 'detail': '', 'body': '', 'errors': "Can't send data when our state is ERROR"}
2023-10-29T12:08:50.143311256Z     Traceback (most recent call last):
2023-10-29T12:08:50.143317742Z       File "/usr/local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 162, in __call__
2023-10-29T12:08:50.143319672Z         await self.app(scope, receive, _send)
2023-10-29T12:08:50.143321176Z       File "/usr/local/lib/python3.10/site-packages/starlette/middleware/base.py", line 109, in __call__
2023-10-29T12:08:50.143322746Z         await response(scope, receive, send)
2023-10-29T12:08:50.143324193Z       File "/usr/local/lib/python3.10/site-packages/starlette/responses.py", line 270, in __call__
2023-10-29T12:08:50.143325747Z         async with anyio.create_task_group() as task_group:
2023-10-29T12:08:50.143327310Z       File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 597, in __aexit__
2023-10-29T12:08:50.143328889Z         raise exceptions[0]
2023-10-29T12:08:50.143330356Z       File "/usr/local/lib/python3.10/site-packages/starlette/responses.py", line 273, in wrap
2023-10-29T12:08:50.143331940Z         await func()
2023-10-29T12:08:50.143333378Z       File "/usr/local/lib/python3.10/site-packages/starlette/middleware/base.py", line 134, in stream_response
2023-10-29T12:08:50.143334936Z         return await super().stream_response(send)
2023-10-29T12:08:50.143336374Z       File "/usr/local/lib/python3.10/site-packages/starlette/responses.py", line 255, in stream_response
2023-10-29T12:08:50.143337913Z         await send(
2023-10-29T12:08:50.143339385Z       File "/usr/local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 159, in _send
2023-10-29T12:08:50.143345034Z         await send(message)
2023-10-29T12:08:50.143346459Z       File "/usr/local/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 490, in send
2023-10-29T12:08:50.143348001Z         output = self.conn.send(event=response)
2023-10-29T12:08:50.143349535Z       File "/usr/local/lib/python3.10/site-packages/h11/_connection.py", line 468, in send
2023-10-29T12:08:50.143351068Z         data_list = self.send_with_data_passthrough(event)
2023-10-29T12:08:50.143352510Z       File "/usr/local/lib/python3.10/site-packages/h11/_connection.py", line 483, in send_with_data_passthrough
2023-10-29T12:08:50.143354098Z         raise LocalProtocolError("Can't send data when our state is ERROR")
2023-10-29T12:08:50.143355692Z     h11._util.LocalProtocolError: Can't send data when our state is ERROR
2023-10-29T12:08:50.143357185Z 
2023-10-29T12:08:50.143358551Z ---
2023-10-29T12:08:50.144046054Z ERROR:    Exception in ASGI application
2023-10-29T12:08:50.144049749Z Traceback (most recent call last):
2023-10-29T12:08:50.144051321Z   File "/usr/local/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 408, in run_asgi
2023-10-29T12:08:50.144052974Z     result = await app(  # type: ignore[func-returns-value]
2023-10-29T12:08:50.144054481Z   File "/usr/local/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in __call__
2023-10-29T12:08:50.144056037Z     return await self.app(scope, receive, send)
2023-10-29T12:08:50.144057482Z   File "/usr/local/lib/python3.10/site-packages/fastapi/applications.py", line 273, in __call__
2023-10-29T12:08:50.144058992Z     await super().__call__(scope, receive, send)
2023-10-29T12:08:50.144060428Z   File "/usr/local/lib/python3.10/site-packages/starlette/applications.py", line 122, in __call__
2023-10-29T12:08:50.144061934Z     await self.middleware_stack(scope, receive, send)
2023-10-29T12:08:50.144063381Z   File "/usr/local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 184, in __call__
2023-10-29T12:08:50.144064916Z     raise exc
2023-10-29T12:08:50.144066354Z   File "/usr/local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 162, in __call__
2023-10-29T12:08:50.144067885Z     await self.app(scope, receive, _send)
2023-10-29T12:08:50.144069304Z   File "/usr/local/lib/python3.10/site-packages/starlette/middleware/base.py", line 109, in __call__
2023-10-29T12:08:50.144070796Z     await response(scope, receive, send)
2023-10-29T12:08:50.144072222Z   File "/usr/local/lib/python3.10/site-packages/starlette/responses.py", line 270, in __call__
2023-10-29T12:08:50.144073738Z     async with anyio.create_task_group() as task_group:
2023-10-29T12:08:50.144075194Z   File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 597, in __aexit__
2023-10-29T12:08:50.144080655Z     raise exceptions[0]
2023-10-29T12:08:50.144082148Z   File "/usr/local/lib/python3.10/site-packages/starlette/responses.py", line 273, in wrap
2023-10-29T12:08:50.144083668Z     await func()
2023-10-29T12:08:50.144085050Z   File "/usr/local/lib/python3.10/site-packages/starlette/middleware/base.py", line 134, in stream_response
2023-10-29T12:08:50.144086614Z     return await super().stream_response(send)
2023-10-29T12:08:50.144088077Z   File "/usr/local/lib/python3.10/site-packages/starlette/responses.py", line 255, in stream_response
2023-10-29T12:08:50.144089624Z     await send(
2023-10-29T12:08:50.144091013Z   File "/usr/local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 159, in _send
2023-10-29T12:08:50.144092528Z     await send(message)
2023-10-29T12:08:50.144093957Z   File "/usr/local/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 490, in send
2023-10-29T12:08:50.144095666Z     output = self.conn.send(event=response)
2023-10-29T12:08:50.144097109Z   File "/usr/local/lib/python3.10/site-packages/h11/_connection.py", line 468, in send
2023-10-29T12:08:50.144098611Z     data_list = self.send_with_data_passthrough(event)
2023-10-29T12:08:50.144100036Z   File "/usr/local/lib/python3.10/site-packages/h11/_connection.py", line 483, in send_with_data_passthrough
2023-10-29T12:08:50.144101549Z     raise LocalProtocolError("Can't send data when our state is ERROR")
2023-10-29T12:08:50.144103060Z h11._util.LocalProtocolError: Can't send data when our state is ERROR
2023-10-29T12:08:50.144315108Z 'AsyncRequest' object has no attribute '_json_response_data'
2023-10-29T12:09:06.578046698Z 9519d49c28ef256fc354dbd46a75bc048d8201ec8069b8003dabff23573f8173

Feature Request - Scan on start

Sorry if I've missed something, I've been looking for this for a while now and I can't find anything. I actually have no problem with the extension which has been fantastic for me. It's an essential component of my workflow now.

However basically I sometimes forget to click the "Scan" button in the CivitAI Helper tab for quite some time. Is there a way to get it to run on some predictable regular interval? For example when Stable Diffusion is started. Something like this. Or even every hour in the background perhaps.

I realise this might add a lot of time on to the startup routine. So it won't be for everyone. Perhaps having it switched off as default would be a good idea.

[BUG] Extension downloads unusable video preview when scanning

Describe Issue

If the model/lora has an animated image as the first image on civitai then it shows up as blank in the preview. It looks like it may be forcing the extension to .png no matter what the media file is. Which is fine for jpegs, but for mp4s it does not work that way.

Example: LORA with animated image (it's an mp4): https://civitai.com/models/144203
Pull it in, then scan and refresh.

Screenshot for UI issue

Shows as blank
image

File was forced to .png by the script
image

Does not open because it is not an image
image

Changed from .png to .mp4
image

Movie starts (proves it's a valid file)
image

Console log's msg or screenshot for function issue

image

webui界面没有"Civitai Helper"这个标签栏

抱歉打扰了。
sorry to disturb.

webUI启动后,界面中没有"Civitai Helper"这个标签选项卡,以至于无法使用。
After webUI is launched, there is no "Civitai Helper" label tab in the interface,so that it cannot be used.

[Translated by Google]

The webUI version is the latest 1.6.0

console error contents:
*** Error executing callback ui_tabs_callback for E:\sd-webui-aki-v4.4\extensions\Stable-Diffusion-Webui-Civitai-Helper\scripts\civitai_helper.py
Traceback (most recent call last):
File "E:\sd-webui-aki-v4.4\modules\script_callbacks.py", line 166, in ui_tabs_callback
res += c.callback() or []
File "E:\sd-webui-aki-v4.4\extensions\Stable-Diffusion-Webui-Civitai-Helper\scripts\civitai_helper.py", line 41, in on_ui_tabs
util.printD(f"Set Proxy: {proxy}", "")
TypeError: printD() takes 1 positional argument but 2 were given

[BUG] Model Description & username should be stored

In a lot of Civitai models, the model description contains extra trigger word and necessary information. Currently this information is not stored (movelVersion description is stored only).

If feature is implemented, it needs to auto-update all info files if model version still exists.

(I changed it to bug as it really is a necessary feature due to the fact many models have the triggers only in the model description)

Also username of author.

Large Civitai.info files causing load issues with theming extensions

Have you read document?

Yes

Have you checked console log window's msg?

Yes

Describe Issue

The images sections of civitai.info files is causing some to be unreasonably long, upwards of over 100k lines and is causing Nevysha's Cozy Nest extension and the Lobe theme to infinitely load the extra networks sections. Stripping that section out of the files resolves the issue.

Would it be possible to, either by default or as an option in the settings menu, have that section stripped out automatically? I don't currently see anything in the webui that uses that information, so ditching it doesnt really seem like a loss...

Screenshot for UI issue

Info File: https://i.imgur.com/Tmhsk3M.png
Nevysha's Cozy Nest Theme Extra Networks: https://i.imgur.com/Ic1thse.png

Console log's msg or screenshot for function issue

Error in console; https://i.imgur.com/LuXsXCa.png

ERROR:    Exception in ASGI application
OverflowError: int too big to convert

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "K:\sdxl\venv\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 408, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "K:\sdxl\venv\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 84, in __call__
    return await self.app(scope, receive, send)
  File "K:\sdxl\venv\lib\site-packages\fastapi\applications.py", line 273, in __call__
    await super().__call__(scope, receive, send)
  File "K:\sdxl\venv\lib\site-packages\starlette\applications.py", line 122, in __call__
    await self.middleware_stack(scope, receive, send)
  File "K:\sdxl\venv\lib\site-packages\starlette\middleware\errors.py", line 184, in __call__
    raise exc
  File "K:\sdxl\venv\lib\site-packages\starlette\middleware\errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "K:\sdxl\venv\lib\site-packages\starlette\middleware\cors.py", line 84, in __call__
    await self.app(scope, receive, send)
  File "K:\sdxl\venv\lib\site-packages\starlette\middleware\gzip.py", line 24, in __call__
    await responder(scope, receive, send)
  File "K:\sdxl\venv\lib\site-packages\starlette\middleware\gzip.py", line 44, in __call__
    await self.app(scope, receive, self.send_with_gzip)
  File "K:\sdxl\venv\lib\site-packages\starlette\middleware\exceptions.py", line 79, in __call__
    raise exc
  File "K:\sdxl\venv\lib\site-packages\starlette\middleware\exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "K:\sdxl\venv\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 21, in __call__
    raise e
  File "K:\sdxl\venv\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "K:\sdxl\venv\lib\site-packages\starlette\routing.py", line 718, in __call__
    await route.handle(scope, receive, send)
  File "K:\sdxl\venv\lib\site-packages\starlette\routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "K:\sdxl\venv\lib\site-packages\starlette\routing.py", line 66, in app
    response = await func(request)
  File "K:\sdxl\venv\lib\site-packages\fastapi\routing.py", line 266, in app
    response = actual_response_class(content, **response_args)
  File "K:\sdxl\venv\lib\site-packages\starlette\responses.py", line 196, in __init__
    super().__init__(content, status_code, headers, media_type, background)
  File "K:\sdxl\venv\lib\site-packages\starlette\responses.py", line 55, in __init__
    self.body = self.render(content)
  File "K:\sdxl\venv\lib\site-packages\gradio\routes.py", line 80, in render
    return ORJSONResponse._render(content)
  File "K:\sdxl\venv\lib\site-packages\gradio\routes.py", line 73, in _render
    return orjson.dumps(
TypeError: Integer exceeds 64-bit range

Need an option to use Lora directory for LyCORIS downloads

Native support for LyCORIS was added to stable-diffusion-webui at v1.5.0 on Jul 25. LyCORIS models are now treated the same as Loras and go in the Lora directory. This thing still wants to download them to models/LyCORIS which doesn't exist, so it fails.

This either needs to:
A) Provide an option to use the Lora directory for LyCORIS downloads.
or
B) Automatically use the Lora directory in v1.5.0 and above.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.