Coder Social home page Coder Social logo

sd-civitai-browser's Introduction

sd-civitai-browser

An extension to help download models from CivitAi without leaving WebUI

sd-civitai-browser's People

Contributors

axelfar94 avatar camenduru avatar etherealxx avatar thetrebor avatar vetchems 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

sd-civitai-browser's Issues

Console got error for elegantHanfuRuqun_v10(a494919e)

LoRA weight: 0.8, model: elegantHanfuRuqun_v10(a494919e)
Error running process: /content/stable-diffusion-webui/extensions/sd-webui-additional-networks/scripts/additional_networks.py
Traceback (most recent call last):
File "/content/stable-diffusion-webui/modules/scripts.py", line 338, in process
script.process(p, *script_args)
File "/content/stable-diffusion-webui/extensions/sd-webui-additional-networks/scripts/additional_networks.py", line 177, in process
network, info = lora_compvis.create_network_and_apply_compvis(du_state_dict, weight, text_encoder, unet)
File "/content/stable-diffusion-webui/extensions/sd-webui-additional-networks/scripts/lora_compvis.py", line 73, in create_network_and_apply_compvis
network_dim = min([s for s in size if s > 1])
ValueError: min() arg is an empty sequence

json structure

from typing import List
from typing import Any
from dataclasses import dataclass
import json
@dataclass
class Creator:
    username: str
    image: str

    @staticmethod
    def from_dict(obj: Any) -> 'Creator':
        _username = str(obj.get("username"))
        _image = str(obj.get("image"))
        return Creator(_username, _image)

@dataclass
class File:
    name: str
    id: int
    sizeKB: float
    type: str
    format: str
    pickleScanResult: str
    pickleScanMessage: str
    virusScanResult: str
    scannedAt: str
    hashes: Hashes
    downloadUrl: str

    @staticmethod
    def from_dict(obj: Any) -> 'File':
        _name = str(obj.get("name"))
        _id = int(obj.get("id"))
        _sizeKB = float(obj.get("sizeKB"))
        _type = str(obj.get("type"))
        _format = str(obj.get("format"))
        _pickleScanResult = str(obj.get("pickleScanResult"))
        _pickleScanMessage = str(obj.get("pickleScanMessage"))
        _virusScanResult = str(obj.get("virusScanResult"))
        _scannedAt = str(obj.get("scannedAt"))
        _hashes = Hashes.from_dict(obj.get("hashes"))
        _downloadUrl = str(obj.get("downloadUrl"))
        return File(_name, _id, _sizeKB, _type, _format, _pickleScanResult, _pickleScanMessage, _virusScanResult, _scannedAt, _hashes, _downloadUrl)

@dataclass
class Hashes:
    SHA256: str
    AutoV1: str
    AutoV2: str
    BLAKE3: str
    CRC32: str

    @staticmethod
    def from_dict(obj: Any) -> 'Hashes':
        _SHA256 = str(obj.get("SHA256"))
        _AutoV1 = str(obj.get("AutoV1"))
        _AutoV2 = str(obj.get("AutoV2"))
        _BLAKE3 = str(obj.get("BLAKE3"))
        _CRC32 = str(obj.get("CRC32"))
        return Hashes(_SHA256, _AutoV1, _AutoV2, _BLAKE3, _CRC32)

@dataclass
class Image:
    url: str
    nsfw: bool
    width: int
    height: int
    hash: str
    meta: Meta

    @staticmethod
    def from_dict(obj: Any) -> 'Image':
        _url = str(obj.get("url"))
        _nsfw = 
        _width = int(obj.get("width"))
        _height = int(obj.get("height"))
        _hash = str(obj.get("hash"))
        _meta = Meta.from_dict(obj.get("meta"))
        return Image(_url, _nsfw, _width, _height, _hash, _meta)

@dataclass
class Item:
    id: int
    name: str
    description: str
    type: str
    poi: bool
    nsfw: bool
    allowNoCredit: bool
    allowCommercialUse: str
    allowDerivatives: bool
    allowDifferentLicense: bool
    creator: Creator
    tags: List[str]
    modelVersions: List[ModelVersion]

    @staticmethod
    def from_dict(obj: Any) -> 'Item':
        _id = int(obj.get("id"))
        _name = str(obj.get("name"))
        _description = str(obj.get("description"))
        _type = str(obj.get("type"))
        _poi = 
        _nsfw = 
        _allowNoCredit = 
        _allowCommercialUse = str(obj.get("allowCommercialUse"))
        _allowDerivatives = 
        _allowDifferentLicense = 
        _creator = Creator.from_dict(obj.get("creator"))
        _tags = [.from_dict(y) for y in obj.get("tags")]
        _modelVersions = [ModelVersion.from_dict(y) for y in obj.get("modelVersions")]
        return Item(_id, _name, _description, _type, _poi, _nsfw, _allowNoCredit, _allowCommercialUse, _allowDerivatives, _allowDifferentLicense, _creator, _tags, _modelVersions)

@dataclass
class Meta:
    ENSD: str
    Size: str
    seed: object
    steps: int
    prompt: str
    sampler: str
    cfgScale: float
    Batch pos: str
    resources: List[Resource]
    Batch size: str
    Model hash: str
    Hires upscale: str
    Hires upscaler: str
    negativePrompt: str
    Denoising strength: str
    Model: str
    Hires steps: str
    Clip skip: str
    Mask blur: str
    SD upscale overlap: str
    SD upscale upscaler: str

    @staticmethod
    def from_dict(obj: Any) -> 'Meta':
        _ENSD = str(obj.get("ENSD"))
        _Size = str(obj.get("Size"))
        _seed = 
        _steps = int(obj.get("steps"))
        _prompt = str(obj.get("prompt"))
        _sampler = str(obj.get("sampler"))
        _cfgScale = float(obj.get("cfgScale"))
        _Batch pos = str(obj.get("Batch pos"))
        _resources = [Resource.from_dict(y) for y in obj.get("resources")]
        _Batch size = str(obj.get("Batch size"))
        _Model hash = str(obj.get("Model hash"))
        _Hires upscale = str(obj.get("Hires upscale"))
        _Hires upscaler = str(obj.get("Hires upscaler"))
        _negativePrompt = str(obj.get("negativePrompt"))
        _Denoising strength = str(obj.get("Denoising strength"))
        _Model = str(obj.get("Model"))
        _Hires steps = str(obj.get("Hires steps"))
        _Clip skip = str(obj.get("Clip skip"))
        _Mask blur = str(obj.get("Mask blur"))
        _SD upscale overlap = str(obj.get("SD upscale overlap"))
        _SD upscale upscaler = str(obj.get("SD upscale upscaler"))
        return Meta(_ENSD, _Size, _seed, _steps, _prompt, _sampler, _cfgScale, _Batch pos, _resources, _Batch size, _Model hash, _Hires upscale, _Hires upscaler, _negativePrompt, _Denoising strength, _Model, _Hires steps, _Clip skip, _Mask blur, _SD upscale overlap, _SD upscale upscaler)

@dataclass
class ModelVersion:
    id: int
    modelId: int
    name: str
    createdAt: str
    updatedAt: str
    trainedWords: List[object]
    baseModel: str
    earlyAccessTimeFrame: int
    description: str
    files: List[File]
    images: List[Image]
    downloadUrl: str

    @staticmethod
    def from_dict(obj: Any) -> 'ModelVersion':
        _id = int(obj.get("id"))
        _modelId = int(obj.get("modelId"))
        _name = str(obj.get("name"))
        _createdAt = str(obj.get("createdAt"))
        _updatedAt = str(obj.get("updatedAt"))
        _trainedWords = [.from_dict(y) for y in obj.get("trainedWords")]
        _baseModel = str(obj.get("baseModel"))
        _earlyAccessTimeFrame = int(obj.get("earlyAccessTimeFrame"))
        _description = str(obj.get("description"))
        _files = [File.from_dict(y) for y in obj.get("files")]
        _images = [Image.from_dict(y) for y in obj.get("images")]
        _downloadUrl = str(obj.get("downloadUrl"))
        return ModelVersion(_id, _modelId, _name, _createdAt, _updatedAt, _trainedWords, _baseModel, _earlyAccessTimeFrame, _description, _files, _images, _downloadUrl)

@dataclass
class Resource:
    hash: str
    name: str
    type: str

    @staticmethod
    def from_dict(obj: Any) -> 'Resource':
        _hash = str(obj.get("hash"))
        _name = str(obj.get("name"))
        _type = str(obj.get("type"))
        return Resource(_hash, _name, _type)

@dataclass
class Root:
    items: List[Item]

    @staticmethod
    def from_dict(obj: Any) -> 'Root':
        _items = [Item.from_dict(y) for y in obj.get("items")]
        return Root(_items)

# Example Usage
# jsonstring = json.loads(myjsonstring)
# root = Root.from_dict(jsonstring)

The extension is not searching anything

The extension doesn't seem to work at all in google colab. I am typing terms to search and its not even pulling the list. the get list button does nothing. I have tried to get loras, embedding but same results. I even tried with search nsfw on and off and by searching with term and without term but its not getting anything. Any Ideas what the issue might be??

Download speed slow

From today, I'm getting ~200 KB/s when downloading via the extension, while downloading from Civitai web page gives 40-60 MB/s.

Did Civitai do something to throttle speed and is it possible to have a workaround it?

help?? use it lora error

error,
when i use lora after downloading it he give this error

extensions/sd-webui-additional-networks/models/lora/CZ2128_Shizu_Delta_Overlord/cz2128ShizuDelta_v10.safetensors successfully downloaded.
LoRA weight: 1, model: cz2128ShizuDelta_v10(c5aa8aa0)
Error running process: /content/stable-diffusion-webui/extensions/sd-webui-additional-networks/scripts/additional_networks.py
Traceback (most recent call last):
File "/content/stable-diffusion-webui/modules/scripts.py", line 338, in process
script.process(p, *script_args)
File "/content/stable-diffusion-webui/extensions/sd-webui-additional-networks/scripts/additional_networks.py", line 177, in process
network, info = lora_compvis.create_network_and_apply_compvis(du_state_dict, weight, text_encoder, unet)
File "/content/stable-diffusion-webui/extensions/sd-webui-additional-networks/scripts/lora_compvis.py", line 73, in create_network_and_apply_compvis
network_dim = min([s for s in size if s > 1])
ValueError: min() arg is an empty sequence

Same problem happened to me with many (lora)

Lora Download: Wrong directory

Hi,

I was triying to download a LORA but it didn´t appear on my list, even if I refresehd the folder.
Taking a look to the log, I saw they are being downloaded to "/stable-diffusion-webui/extensions/sd-webui-additional-networks/models/lora" instead of "/stable-diffusion-webui/models/Lora"

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.