GithubHelp home page GithubHelp logo

ai-forever / kandinsky-2 Goto Github PK

View Code? Open in Web Editor NEW
2.7K 48.0 304.0 38.16 MB

Kandinsky 2 — multilingual text2image latent diffusion model

License: Apache License 2.0

Python 3.04% Jupyter Notebook 96.96%
image-generation text-to-image diffusion image2image inpainting ipython-notebook kandinsky outpainting text2image

kandinsky-2's People

Contributors

alexwortega avatar boomb0om avatar cene555 avatar denndimitrov avatar kuznetsoffandrey avatar razzant 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  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

kandinsky-2's Issues

Runtime error using cpu instead of cuda

Output exceeds the size limit. Open the full output data in a text editor---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Cell In[3], line 1
----> 1 model = get_kandinsky2(
2 'cuda',
3 task_type='text2img',
4 cache_dir='/tmp/kandinsky2',
5 model_version='2.1',
6 use_flash_attention=False
7 )

File f:\AI_Scripts\Kandinsky 2.1\2.1\Kandisky\lib\site-packages\kandinsky2_init_.py:179, in get_kandinsky2(device, task_type, cache_dir, use_auth_token, model_version, use_flash_attention)
172 model = get_kandinsky2_0(
173 device,
174 task_type=task_type,
175 cache_dir=cache_dir,
176 use_auth_token=use_auth_token,
177 )
178 elif model_version == "2.1":
--> 179 model = get_kandinsky2_1(
180 device,
181 task_type=task_type,
182 cache_dir=cache_dir,
183 use_auth_token=use_auth_token,
184 use_flash_attention=use_flash_attention,
...
170 'to map your storages to the CPU.')
171 device_count = torch.cuda.device_count()
172 if device >= device_count:

RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU.

tried switching fp16 to false with the workaround from another thread wasn't able to get it to work.

cant`get file

when i run
model = get_kandinsky2('cuda', task_type='text2img', model_version='2.1', use_flash_attention=False)

,it raise error

 Traceback (most recent call last):
   File "sketch2img.py", line 24, in <module>
        model = get_kandinsky2('cuda', task_type='text2img', model_version='2.1', use_flash_attention=False)
   File "/root/jobs/Kandinsky-2/kandinsky2/__init__.py", line 179, in get_kandinsky2
        model = get_kandinsky2_1(
   File "/root/jobs/Kandinsky-2/kandinsky2/__init__.py", line 159, in get_kandinsky2_1
        model = Kandinsky2_1(config, cache_model_name, cache_prior_name, device, task_type=task_type)
   File "/root/jobs/Kandinsky-2/kandinsky2/kandinsky2_1_model.py", line 60, in __init__
        self.text_encoder = TextEncoder(**self.config["text_enc_params"])
   File "/root/jobs/Kandinsky-2/kandinsky2/model/text_encoders.py", line 144, in __init__
        torch.load(os.path.join(model_path, "pytorch_model.bin")), strict=False
   File "/root/miniconda3/envs/test/lib/python3.8/site-packages/torch/serialization.py", line 797, in load
        with _open_zipfile_reader(opened_file) as opened_zipfile:
   File "/root/miniconda3/envs/test/lib/python3.8/site-packages/torch/serialization.py", line 283, in __init__
       super().__init__(torch._C.PyTorchFileReader(name_or_buffer))
 RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

it seems like the file can not be found,what can i do to resolve it

Deprecation warning

Importing Kandinsky issues a deprecation warning:

>>> from kandinsky2 import get_kandinsky2
/usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 1.1build1 is an invalid version and will not be supported in a future release
  warnings.warn(

Getting kandinsky issues a future warning:

>>> model = get_kandinsky2('cuda', task_type='text2img')
/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py:637: FutureWarning: `cached_download` is the legacy way to download files from the HF hub, please consider upgrading to `hf_hub_download`
  warnings.warn(

Couldn't build proto file into description pool

While getting kandinsky model, I get the following error.

>>> model = get_kandinsky2('cuda', task_type='text2img')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.10/dist-packages/kandinsky2/__init__.py", line 64, in get_kandinsky2
    model = Kandinsky2(config, unet_path, device, task_type)
  File "/usr/local/lib/python3.10/dist-packages/kandinsky2/kandinsky2_model.py", line 30, in __init__
    self.tokenizer2 = AutoTokenizer.from_pretrained(self.config['tokenizer_name2'])
  File "/usr/local/lib/python3.10/dist-packages/transformers/models/auto/tokenization_auto.py", line 610, in from_pretrained
    return tokenizer_class.from_pretrained(pretrained_model_name_or_path, *inputs, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/transformers/tokenization_utils_base.py", line 1775, in from_pretrained
    return cls._from_pretrained(
  File "/usr/local/lib/python3.10/dist-packages/transformers/tokenization_utils_base.py", line 1930, in _from_pretrained    tokenizer = cls(*init_inputs, **init_kwargs)
  File "/usr/local/lib/python3.10/dist-packages/transformers/models/t5/tokenization_t5_fast.py", line 134, in __init__
    super().__init__(
  File "/usr/local/lib/python3.10/dist-packages/transformers/tokenization_utils_fast.py", line 114, in __init__
    fast_tokenizer = convert_slow_tokenizer(slow_tokenizer)
  File "/usr/local/lib/python3.10/dist-packages/transformers/convert_slow_tokenizer.py", line 1162, in convert_slow_tokenizer
    return converter_class(transformer_tokenizer).converted()
  File "/usr/local/lib/python3.10/dist-packages/transformers/convert_slow_tokenizer.py", line 438, in __init__
    from .utils import sentencepiece_model_pb2 as model_pb2
  File "/usr/local/lib/python3.10/dist-packages/transformers/utils/sentencepiece_model_pb2.py", line 29, in <module>
    DESCRIPTOR = _descriptor.FileDescriptor(
  File "/usr/local/lib/python3.10/dist-packages/google/protobuf/descriptor.py", line 1066, in __new__
    return _message.default_pool.AddSerializedFile(serialized_pb)
TypeError: Couldn't build proto file into descriptor pool: duplicate file name sentencepiece_model.proto

Inpainting pipeline giving dimension errors

I've tried running the inpainting pipeline in both 2.0 and 2.1 but got the following error in both the cases,

ValueError: Input and output must have the same number of spatial dimensions, but got input with spatial dimensions of [768, 768, 3] and output size of (96, 96). Please provide input tensor in (N, C, d1, d2, ...,dK) format and output size in (o1, o2, ...,oK) format.

I've tried resizing the input images to match the h and w arguments of the inpainting but the result was same. Please find the inputs and rest of the details below,

Input Image:
image

Mask:
image

Prompt:
a herd of grazing sheep

Code:

model = get_kandinsky2("cuda", task_type='inpainting', model_version="2.1", use_flash_attention=False)
init_image = Image.open('samples/inpaint/desktop.png').convert("RGB")
mask = Image.open('samples/inpaint/desktop-mask.png').convert("RGB")
images = model.generate_inpainting(prompt, init_image, mask, num_steps=150, batch_size=1, guidance_scale=5, h=768, w=768, sampler='p_sampler', prior_cf_scale=4, prior_steps="5")

Did I miss something here? Rest of the pipelines are working fine for me

How to install and run tutorial

I made a pull request but until it is approved this thread can stay open?

Moreover if you get Cuda error you can install this below pytorch

pip3 install torch==1.13.1 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117

27.) Python Script - Jupyter Based - PC - Free
Midjourney Level NEW Open Source Kandinsky 2.1 Beats Stable Diffusion - Installation And Usage Guide
image

if you get cuda errors and if you cant fix them, you can make a python virtual environment by following this video

10.) Python Code - Hugging Face Diffusers Script - PC - Free
How to Run and Convert Stable Diffusion Diffusers (.bin Weights) & Dreambooth Models to CKPT File
image

Warning

While running model.generate_text2img(text) I got the following warnings:

  warnings.warn(
/usr/local/lib/python3.10/dist-packages/transformers/convert_slow_tokenizer.py:446: UserWarning: The sentencepiece tokenizer that you are converting to a fast tokenizer uses the byte fallback option which is not implemented in the fast tokenizers. In practice this means that the fast version of the tokenizer can produce unknown tokens whereas the sentencepiece version would have converted these unknown tokens into a sequence of byte tokens matching the original piece of text.  

warnings.warn(
Some weights of the model checkpoint at /tmp/kandinsky2/text_encoder1 were not used when initializing XLMRobertaModel: ['transformer.encoder.layer.6.attention.self.query.bias', 'transformer.encoder.layer.9.attention.self.query.bias', ... 

What are the benefits?

I'm curious, is using AI on multiple languages in the same interpreter, with discrimination, really appropriate? What is the benefit here? Is there any loss in language with them all together over versions a focused larger single language?

When I look at the results from these model, like the example here and model architecture graph, why are they all influenced by the culture of a detected image? For example, here the teddy bear is on a skate board next to iconic Russian landmarks you'd get from simply prompting "Russia". To me this seems like severe contamination from discrimination in detection.

We use Google on a service I work for, because all the multi-lingual CLIP models don't seem to actually work right. By simply translating the prompt before it hits any AI to create anomalies, you get more cohesive results that are "true" so to speak.

These are made on https://idun.ai which uses Google Services to translate from over 100 languages (free to use on anything running python from pip).

Un ours en peluche sur une planche un skateboard
image

A teddy bear on a skateboard
image

I would consider these results "accurate" because they convey what you want, and it is a neutral environment not contaminated by a detected nationalities most stereotypical landmarks. It correctly represents the dataset for skating, neutral environments where skaters are captured for datasets, and then satisfies teddy bear.

UnboundLocalError: local variable 'config_file_url' referenced before assignment

The error in the title show up when i try to load multiple models from get_kandinsky2 for different tasks

text2img_model = get_kandinsky2("cuda", task_type="text2img", model_version="2.1", use_flash_attention=True)
img2img_model = get_kandinsky2("cuda", task_type="img2img", model_version="2.1", use_flash_attention=True)

Не ставится kandinskiy-2

(venv) vitaliy@MacBook-Air marvin % pip3 install marvin install 'git+https://github.com/ai-forever/Kandinsky-2.git'
Collecting git+https://github.com/ai-forever/Kandinsky-2.git
Cloning https://github.com/ai-forever/Kandinsky-2.git to /private/var/folders/dq/fs9xh36x1p5dsv1bwkckgb4r0000gn/T/pip-req-build-yb3_05tm
Running command git clone --filter=blob:none --quiet https://github.com/ai-forever/Kandinsky-2.git /private/var/folders/dq/fs9xh36x1p5dsv1bwkckgb4r0000gn/T/pip-req-build-yb3_05tm
Resolved https://github.com/ai-forever/Kandinsky-2.git to commit 09bd3e8
Preparing metadata (setup.py) ... done
Collecting marvin
Using cached marvin-0.6.4-py3-none-any.whl (81 kB)
Collecting install
Using cached install-1.3.5-py3-none-any.whl (3.2 kB)
Collecting aiofiles~=23.1
Using cached aiofiles-23.1.0-py3-none-any.whl (14 kB)
Collecting aiosqlite~=0.18
Using cached aiosqlite-0.18.0-py3-none-any.whl (15 kB)
Collecting asyncpg~=0.27
Using cached asyncpg-0.27.0-cp311-cp311-macosx_10_9_x86_64.whl (621 kB)
Collecting cloudpickle~=2.2
Using cached cloudpickle-2.2.1-py3-none-any.whl (25 kB)
Collecting datamodel-code-generator~=0.17
Using cached datamodel_code_generator-0.17.2-py3-none-any.whl (75 kB)
Collecting fastapi~=0.89
Using cached fastapi-0.95.0-py3-none-any.whl (57 kB)
Collecting httpx~=0.23
Using cached httpx-0.23.3-py3-none-any.whl (71 kB)
Collecting jinja2~=3.1
Using cached Jinja2-3.1.2-py3-none-any.whl (133 kB)
Collecting langchain~=0.0.103
Using cached langchain-0.0.130-py3-none-any.whl (472 kB)
Collecting nest-asyncio~=1.5
Using cached nest_asyncio-1.5.6-py3-none-any.whl (5.2 kB)
Collecting openai~=0.27
Using cached openai-0.27.2-py3-none-any.whl (70 kB)
Collecting pendulum~=2.1
Using cached pendulum-2.1.2.tar.gz (81 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting prefect~=2.8
Using cached prefect-2.9.0-py3-none-any.whl (2.2 MB)
Collecting pydantic[dotenv]=1.10
Using cached pydantic-1.10.7-cp311-cp311-macosx_10_9_x86_64.whl (2.8 MB)
Collecting rich
=13.3
Using cached rich-13.3.3-py3-none-any.whl (238 kB)
Collecting sqlalchemy[asyncio]=1.4
Using cached SQLAlchemy-1.4.47-cp311-cp311-macosx_10_9_universal2.whl (1.6 MB)
Requirement already satisfied: sqlitedict
=2.1 in ./venv/lib/python3.11/site-packages (from marvin) (2.1.0)
Collecting sqlmodel~=0.0.8
Using cached sqlmodel-0.0.8-py3-none-any.whl (21 kB)
Collecting tiktoken~=0.3
Using cached tiktoken-0.3.3-cp311-cp311-macosx_10_9_x86_64.whl (735 kB)
Requirement already satisfied: ulid-py~=1.1 in ./venv/lib/python3.11/site-packages (from marvin) (1.1.0)
Collecting uvicorn~=0.20
Using cached uvicorn-0.21.1-py3-none-any.whl (57 kB)
Collecting xxhash~=3.2
Using cached xxhash-3.2.0-cp311-cp311-macosx_10_9_x86_64.whl (35 kB)
Collecting yake~=0.4
Using cached yake-0.4.8-py2.py3-none-any.whl (60 kB)
Collecting typer~=0.7
Using cached typer-0.7.0-py3-none-any.whl (38 kB)
Collecting beautifulsoup4~=4.11
Using cached beautifulsoup4-4.12.0-py3-none-any.whl (132 kB)
Collecting bleach~=6.0
Using cached bleach-6.0.0-py3-none-any.whl (162 kB)
Collecting duckduckgo-search~=2.8
Using cached duckduckgo_search-2.8.5-py3-none-any.whl (30 kB)
Collecting fake-useragent~=1.1
Using cached fake_useragent-1.1.3-py3-none-any.whl (50 kB)
Collecting google-api-python-client~=2.72
Using cached google_api_python_client-2.83.0-py2.py3-none-any.whl (11.2 MB)
Requirement already satisfied: simpleeval~=0.9 in ./venv/lib/python3.11/site-packages (from marvin) (0.9.13)
Collecting trafilatura~=1.4
Using cached trafilatura-1.5.0-py3-none-any.whl (1.0 MB)
Collecting chardet~=5.1
Using cached chardet-5.1.0-py3-none-any.whl (199 kB)
Collecting wikipedia~=1.4
Using cached wikipedia-1.4.0-py3-none-any.whl
Collecting Pillow
Using cached Pillow-9.5.0-cp311-cp311-macosx_10_10_x86_64.whl (3.4 MB)
Collecting attrs
Using cached attrs-22.2.0-py3-none-any.whl (60 kB)
Collecting torch
Using cached torch-2.0.0-cp311-none-macosx_10_9_x86_64.whl (139.5 MB)
Collecting filelock
Using cached filelock-3.10.7-py3-none-any.whl (10 kB)
Collecting requests
Using cached requests-2.28.2-py3-none-any.whl (62 kB)
Collecting tqdm
Using cached tqdm-4.65.0-py3-none-any.whl (77 kB)
Collecting ftfy
Using cached ftfy-6.1.1-py3-none-any.whl (53 kB)
Collecting regex
Using cached regex-2023.3.23-cp311-cp311-macosx_10_9_x86_64.whl (294 kB)
Collecting numpy
Using cached numpy-1.24.2-cp311-cp311-macosx_10_9_x86_64.whl (19.8 MB)
Collecting blobfile
Using cached blobfile-2.0.1-py3-none-any.whl (73 kB)
Collecting transformers==4.23.1
Using cached transformers-4.23.1-py3-none-any.whl (5.3 MB)
Collecting torchvision
Using cached torchvision-0.15.1-cp311-cp311-macosx_10_9_x86_64.whl (1.5 MB)
Collecting omegaconf
Using cached omegaconf-2.3.0-py3-none-any.whl (79 kB)
Collecting pytorch_lightning
Using cached pytorch_lightning-2.0.1-py3-none-any.whl (716 kB)
Collecting einops
Using cached einops-0.6.0-py3-none-any.whl (41 kB)
Collecting sentencepiece
Using cached sentencepiece-0.1.97.tar.gz (524 kB)
Preparing metadata (setup.py) ... done
Collecting huggingface-hub<1.0,>=0.10.0
Using cached huggingface_hub-0.13.3-py3-none-any.whl (199 kB)
Collecting packaging>=20.0
Using cached packaging-23.0-py3-none-any.whl (42 kB)
Collecting pyyaml>=5.1
Using cached PyYAML-6.0-cp311-cp311-macosx_10_9_x86_64.whl (188 kB)
Requirement already satisfied: tokenizers!=0.11.3,<0.14,>=0.11.1 in ./venv/lib/python3.11/site-packages (from transformers==4.23.1->kandinsky2==0.0.0) (0.13.2)
Collecting soupsieve>1.2
Using cached soupsieve-2.4-py3-none-any.whl (37 kB)
Collecting six>=1.9.0
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Requirement already satisfied: webencodings in ./venv/lib/python3.11/site-packages (from bleach~=6.0->marvin) (0.5.1)
Collecting PySnooper<2.0.0,>=0.4.1
Using cached PySnooper-1.1.1-py2.py3-none-any.whl (14 kB)
Collecting argcomplete<4.0,>=1.10
Using cached argcomplete-3.0.5-py3-none-any.whl (40 kB)
Collecting black>=19.10b0
Using cached black-23.3.0-cp311-cp311-macosx_10_16_x86_64.whl (1.5 MB)
Collecting genson<2.0,>=1.2.1
Using cached genson-1.2.2-py2.py3-none-any.whl
Collecting inflect<6.0,>=4.1.0
Using cached inflect-5.6.2-py3-none-any.whl (33 kB)
Collecting isort<6.0,>=4.3.21
Using cached isort-5.12.0-py3-none-any.whl (91 kB)
Collecting openapi-spec-validator<=0.5.1,>=0.2.8
Using cached openapi_spec_validator-0.5.1-py3-none-any.whl (31 kB)
Collecting prance<1.0,>=0.18.2
Using cached prance-0.22.11.4.0-py3-none-any.whl (36 kB)
Collecting toml<1.0.0,>=0.10.0
Using cached toml-0.10.2-py2.py3-none-any.whl (16 kB)
Collecting typed-ast>=1.5.0
Using cached typed_ast-1.5.4-cp311-cp311-macosx_10_9_universal2.whl
Collecting click>=8.1.3
Using cached click-8.1.3-py3-none-any.whl (96 kB)
Collecting starlette<0.27.0,>=0.26.1
Using cached starlette-0.26.1-py3-none-any.whl (66 kB)
Collecting httplib2<1dev,>=0.15.0
Using cached httplib2-0.22.0-py3-none-any.whl (96 kB)
Collecting google-auth<3.0.0dev,>=1.19.0
Using cached google_auth-2.17.1-py2.py3-none-any.whl (178 kB)
Collecting google-auth-httplib2>=0.1.0
Using cached google_auth_httplib2-0.1.0-py2.py3-none-any.whl (9.3 kB)
Collecting google-api-core!=2.0.,!=2.1.,!=2.2.,!=2.3.0,<3.0.0dev,>=1.31.5
Using cached google_api_core-2.11.0-py3-none-any.whl (120 kB)
Collecting uritemplate<5,>=3.0.1
Using cached uritemplate-4.1.1-py2.py3-none-any.whl (10 kB)
Collecting certifi
Using cached certifi-2022.12.7-py3-none-any.whl (155 kB)
Collecting httpcore<0.17.0,>=0.15.0
Using cached httpcore-0.16.3-py3-none-any.whl (69 kB)
Collecting rfc3986[idna2008]<2,>=1.3
Using cached rfc3986-1.5.0-py2.py3-none-any.whl (31 kB)
Collecting sniffio
Using cached sniffio-1.3.0-py3-none-any.whl (10 kB)
Collecting MarkupSafe>=2.0
Using cached MarkupSafe-2.1.2-cp311-cp311-macosx_10_9_x86_64.whl (13 kB)
Collecting aiohttp<4.0.0,>=3.8.3
Using cached aiohttp-3.8.4-cp311-cp311-macosx_10_9_x86_64.whl (355 kB)
Collecting dataclasses-json<0.6.0,>=0.5.7
Using cached dataclasses_json-0.5.7-py3-none-any.whl (25 kB)
Collecting tenacity<9.0.0,>=8.1.0
Using cached tenacity-8.2.2-py3-none-any.whl (24 kB)
Collecting python-dateutil<3.0,>=2.6
Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting pytzdata>=2020.1
Using cached pytzdata-2020.1-py2.py3-none-any.whl (489 kB)
Collecting alembic>=1.7.5
Using cached alembic-1.10.2-py3-none-any.whl (212 kB)
Collecting anyio>=3.4.0
Using cached anyio-3.6.2-py3-none-any.whl (80 kB)
Collecting apprise>=1.1.0
Using cached apprise-1.3.0-py2.py3-none-any.whl (1.1 MB)
Collecting asgi-lifespan>=1.0
Using cached asgi_lifespan-2.1.0-py3-none-any.whl (10 kB)
Collecting coolname>=1.0.4
Using cached coolname-2.2.0-py2.py3-none-any.whl (37 kB)
Collecting croniter>=1.0.12
Using cached croniter-1.3.8-py2.py3-none-any.whl (18 kB)
Collecting cryptography>=36.0.1
Using cached cryptography-40.0.1-cp36-abi3-macosx_10_12_x86_64.whl (2.8 MB)
Collecting dateparser>=1.1.1
Using cached dateparser-1.1.8-py2.py3-none-any.whl (293 kB)
Collecting docker>=4.0
Using cached docker-6.0.1-py3-none-any.whl (147 kB)
Collecting fsspec!=2023.3.0,>=2022.5.0
Using cached fsspec-2023.1.0-py3-none-any.whl (143 kB)
Collecting griffe>=0.20.0
Using cached griffe-0.26.0-py3-none-any.whl (88 kB)
Collecting jsonpatch>=1.32
Using cached jsonpatch-1.32-py2.py3-none-any.whl (12 kB)
Collecting jsonschema<5.0.0,>=3.2.0
Using cached jsonschema-4.17.3-py3-none-any.whl (90 kB)
Collecting kubernetes>=24.2.0
Using cached kubernetes-26.1.0-py2.py3-none-any.whl (1.4 MB)
Collecting orjson>=3.7
Using cached orjson-3.8.9-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (488 kB)
Collecting pathspec>=0.8.0
Using cached pathspec-0.11.1-py3-none-any.whl (29 kB)
Collecting python-slugify>=5.0
Using cached python_slugify-8.0.1-py2.py3-none-any.whl (9.7 kB)
Collecting pytz>=2021.1
Using cached pytz-2023.3-py2.py3-none-any.whl (502 kB)
Collecting readchar>=4.0.0
Using cached readchar-4.0.5-py3-none-any.whl (8.5 kB)
Collecting typing-extensions>=4.1.0
Using cached typing_extensions-4.5.0-py3-none-any.whl (27 kB)
Collecting websockets>=10.4
Using cached websockets-11.0-cp311-cp311-macosx_10_9_x86_64.whl (120 kB)
Collecting python-dotenv>=0.10.4
Using cached python_dotenv-1.0.0-py3-none-any.whl (19 kB)
Collecting charset-normalizer<4,>=2
Using cached charset_normalizer-3.1.0-cp311-cp311-macosx_10_9_x86_64.whl (123 kB)
Collecting idna<4,>=2.5
Using cached idna-3.4-py3-none-any.whl (61 kB)
Collecting urllib3<1.27,>=1.21.1
Using cached urllib3-1.26.15-py2.py3-none-any.whl (140 kB)
Collecting markdown-it-py<3.0.0,>=2.2.0
Using cached markdown_it_py-2.2.0-py3-none-any.whl (84 kB)
Collecting pygments<3.0.0,>=2.13.0
Using cached Pygments-2.14.0-py3-none-any.whl (1.1 MB)
Collecting greenlet!=0.4.17
Using cached greenlet-2.0.2-cp311-cp311-macosx_10_9_universal2.whl (243 kB)
INFO: pip is looking at multiple versions of sqlitedict to determine which version is compatible with other requirements. This could take a while.
Collecting sqlitedict~=2.1
Using cached sqlitedict-2.1.0-py3-none-any.whl
INFO: pip is looking at multiple versions of sqlalchemy[asyncio] to determine which version is compatible with other requirements. This could take a while.
Collecting sqlalchemy[asyncio]=1.4
Using cached SQLAlchemy-1.4.46-cp311-cp311-macosx_10_9_universal2.whl (1.6 MB)
Using cached SQLAlchemy-1.4.45-cp311-cp311-macosx_10_9_universal2.whl (1.6 MB)
Using cached SQLAlchemy-1.4.44-cp311-cp311-macosx_10_9_universal2.whl (1.6 MB)
Using cached SQLAlchemy-1.4.43-cp311-cp311-macosx_10_9_universal2.whl (1.6 MB)
Using cached SQLAlchemy-1.4.42-cp311-cp311-macosx_10_9_universal2.whl (1.6 MB)
Using cached SQLAlchemy-1.4.41-cp311-cp311-macosx_10_15_x86_64.whl (1.5 MB)
Collecting sqlalchemy2-stubs
Using cached sqlalchemy2_stubs-0.0.2a32-py3-none-any.whl (191 kB)
Collecting courlan>=0.9.0
Using cached courlan-0.9.0-py3-none-any.whl (40 kB)
Collecting htmldate>=1.4.2
Using cached htmldate-1.4.2-py3-none-any.whl (33 kB)
Collecting justext>=3.0.0
Using cached jusText-3.0.0-py2.py3-none-any.whl (837 kB)
Collecting lxml>=4.9.2
Using cached lxml-4.9.2-cp311-cp311-macosx_10_9_universal2.whl
Collecting h11>=0.8
Using cached h11-0.14.0-py3-none-any.whl (58 kB)
Collecting tabulate
Using cached tabulate-0.9.0-py3-none-any.whl (35 kB)
Collecting segtok
Using cached segtok-1.5.11-py3-none-any.whl (24 kB)
Collecting networkx
Using cached networkx-3.0-py3-none-any.whl (2.0 MB)
Collecting jellyfish
Using cached jellyfish-0.11.2-cp311-cp311-macosx_10_7_x86_64.whl (328 kB)
Collecting pycryptodomex
=3.8
Using cached pycryptodomex-3.17-cp35-abi3-macosx_10_9_x86_64.whl (1.6 MB)
Requirement already satisfied: wcwidth>=0.2.5 in ./venv/lib/python3.11/site-packages (from ftfy->kandinsky2==0.0.0) (0.2.6)
Collecting antlr4-python3-runtime==4.9.

Using cached antlr4-python3-runtime-4.9.3.tar.gz (117 kB)
Preparing metadata (setup.py) ... done
Collecting fsspec[http]>2021.06.0
Using cached fsspec-2023.3.0-py3-none-any.whl (145 kB)
Collecting torchmetrics>=0.7.0
Using cached torchmetrics-0.11.4-py3-none-any.whl (519 kB)
Collecting lightning-utilities>=0.7.0
Using cached lightning_utilities-0.8.0-py3-none-any.whl (20 kB)
Collecting sympy
Using cached sympy-1.11.1-py3-none-any.whl (6.5 MB)
Collecting multidict<7.0,>=4.5
Using cached multidict-6.0.4-cp311-cp311-macosx_10_9_x86_64.whl (29 kB)
Collecting async-timeout<5.0,>=4.0.0a3
Using cached async_timeout-4.0.2-py3-none-any.whl (5.8 kB)
Collecting yarl<2.0,>=1.0
Using cached yarl-1.8.2-cp311-cp311-macosx_10_9_x86_64.whl (59 kB)
Collecting frozenlist>=1.1.1
Using cached frozenlist-1.3.3-cp311-cp311-macosx_10_9_x86_64.whl (35 kB)
Collecting aiosignal>=1.1.2
Using cached aiosignal-1.3.1-py3-none-any.whl (7.6 kB)
Collecting Mako
Using cached Mako-1.2.4-py3-none-any.whl (78 kB)
Collecting requests-oauthlib
Using cached requests_oauthlib-1.3.1-py2.py3-none-any.whl (23 kB)
Collecting markdown
Using cached Markdown-3.4.3-py3-none-any.whl (93 kB)
Collecting mypy-extensions>=0.4.3
Using cached mypy_extensions-1.0.0-py3-none-any.whl (4.7 kB)
Collecting platformdirs>=2
Using cached platformdirs-3.2.0-py3-none-any.whl (14 kB)
Collecting langcodes>=3.3.0
Using cached langcodes-3.3.0-py3-none-any.whl (181 kB)
Collecting tld>=0.13
Using cached tld-0.13-py2.py3-none-any.whl (263 kB)
Collecting cffi>=1.12
Using cached cffi-1.15.1-cp311-cp311-macosx_10_9_x86_64.whl (179 kB)
Collecting marshmallow<4.0.0,>=3.3.0
Using cached marshmallow-3.19.0-py3-none-any.whl (49 kB)
Collecting marshmallow-enum<2.0.0,>=1.5.1
Using cached marshmallow_enum-1.5.1-py2.py3-none-any.whl (4.2 kB)
Collecting typing-inspect>=0.4.0
Using cached typing_inspect-0.8.0-py3-none-any.whl (8.7 kB)
Collecting tzlocal
Using cached tzlocal-4.3-py3-none-any.whl (20 kB)
Collecting websocket-client>=0.32.0
Using cached websocket_client-1.5.1-py3-none-any.whl (55 kB)
Collecting googleapis-common-protos<2.0dev,>=1.56.2
Using cached googleapis_common_protos-1.59.0-py2.py3-none-any.whl (223 kB)
Collecting protobuf!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0dev,>=3.19.5
Using cached protobuf-4.22.1-cp37-abi3-macosx_10_9_universal2.whl (397 kB)
Collecting cachetools<6.0,>=2.0.0
Using cached cachetools-5.3.0-py3-none-any.whl (9.3 kB)
Collecting pyasn1-modules>=0.2.1
Using cached pyasn1_modules-0.2.8-py2.py3-none-any.whl (155 kB)
Collecting rsa<5,>=3.1.4
Using cached rsa-4.9-py3-none-any.whl (34 kB)
Collecting colorama>=0.4
Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Collecting pyparsing!=3.0.0,!=3.0.1,!=3.0.2,!=3.0.3,<4,>=2.4.2
Using cached pyparsing-3.0.9-py3-none-any.whl (98 kB)
Collecting h2<5,>=3
Using cached h2-4.1.0-py3-none-any.whl (57 kB)
Collecting jsonpointer>=1.9
Using cached jsonpointer-2.3-py2.py3-none-any.whl (7.8 kB)
Collecting pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0
Using cached pyrsistent-0.19.3-cp311-cp311-macosx_10_9_universal2.whl (82 kB)
Requirement already satisfied: setuptools>=21.0.0 in ./venv/lib/python3.11/site-packages (from kubernetes>=24.2.0->prefect~=2.8->marvin) (65.5.0)
Collecting mdurl~=0.1
Using cached mdurl-0.1.2-py3-none-any.whl (10.0 kB)
Collecting importlib-resources<6.0.0,>=5.8.0
Using cached importlib_resources-5.12.0-py3-none-any.whl (36 kB)
Collecting jsonschema-spec<0.2.0,>=0.1.1
Using cached jsonschema_spec-0.1.4-py3-none-any.whl (12 kB)
Collecting lazy-object-proxy<2.0.0,>=1.7.1
Using cached lazy_object_proxy-1.9.0-cp311-cp311-macosx_10_9_x86_64.whl (22 kB)
Collecting openapi-schema-validator<0.4.0,>=0.3.2
Using cached openapi_schema_validator-0.3.4-py3-none-any.whl (9.8 kB)
Collecting prance<1.0,>=0.18.2
Using cached prance-0.22.2.22.0-py3-none-any.whl (36 kB)
Collecting ruamel.yaml>=0.17.10
Using cached ruamel.yaml-0.17.21-py3-none-any.whl (109 kB)
Collecting email-validator>=1.0.3
Using cached email_validator-1.3.1-py2.py3-none-any.whl (22 kB)
Requirement already satisfied: text-unidecode>=1.3 in ./venv/lib/python3.11/site-packages (from python-slugify>=5.0->prefect~=2.8->marvin) (1.3)
Collecting mpmath>=0.19
Using cached mpmath-1.3.0-py3-none-any.whl (536 kB)
Collecting pycparser
Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Collecting dnspython>=1.15.0
Using cached dnspython-2.3.0-py3-none-any.whl (283 kB)
Collecting hyperframe<7,>=6.0
Using cached hyperframe-6.0.1-py3-none-any.whl (12 kB)
Collecting hpack<5,>=4.0
Using cached hpack-4.0.0-py3-none-any.whl (32 kB)
Collecting pathable<0.5.0,>=0.4.1
Using cached pathable-0.4.3-py3-none-any.whl (9.6 kB)
Collecting pyasn1<0.5.0,>=0.4.6
Using cached pyasn1-0.4.8-py2.py3-none-any.whl (77 kB)
Collecting oauthlib>=3.0.0
Using cached oauthlib-3.2.2-py3-none-any.whl (151 kB)
Collecting pytz-deprecation-shim
Using cached pytz_deprecation_shim-0.1.0.post0-py2.py3-none-any.whl (15 kB)
Collecting tzdata
Using cached tzdata-2023.3-py2.py3-none-any.whl (341 kB)
Building wheels for collected packages: pendulum
Building wheel for pendulum (pyproject.toml) ... done
Created wheel for pendulum: filename=pendulum-2.1.2-cp311-cp311-macosx_12_0_x86_64.whl size=144177 sha256=c06b8041667c5f00914cbe588bba6a9bcd9dcf5d40d7920c56c1d1287e692390
Stored in directory: /Users/vitaliy/Library/Caches/pip/wheels/a4/b7/10/a86f4f49b1bdf8a0cf3da42d48f499e4cb7529ebab7aad3550
Successfully built pendulum
Installing collected packages: sentencepiece, rfc3986, pytz, PySnooper, pyasn1, mpmath, genson, fake-useragent, coolname, antlr4-python3-runtime, xxhash, websockets, websocket-client, urllib3, uritemplate, tzdata, typing-extensions, typed-ast, tqdm, toml, tld, tenacity, tabulate, sympy, soupsieve, sniffio, six, ruamel.yaml, rsa, regex, readchar, pyyaml, pytzdata, python-slugify, python-dotenv, pyrsistent, pyparsing, pygments, pycryptodomex, pycparser, pyasn1-modules, protobuf, platformdirs, Pillow, pathspec, pathable, packaging, orjson, oauthlib, numpy, networkx, nest-asyncio, mypy-extensions, multidict, mdurl, MarkupSafe, markdown, lxml, lazy-object-proxy, langcodes, jsonpointer, jellyfish, isort, install, inflect, importlib-resources, idna, hyperframe, hpack, h11, greenlet, ftfy, fsspec, frozenlist, filelock, einops, dnspython, colorama, cloudpickle, click, charset-normalizer, chardet, certifi, cachetools, attrs, asyncpg, async-timeout, argcomplete, aiosqlite, aiofiles, yarl, uvicorn, typing-inspect, typer, sqlalchemy2-stubs, sqlalchemy, segtok, requests, pytz-deprecation-shim, python-dateutil, pydantic, omegaconf, marshmallow, markdown-it-py, Mako, lightning-utilities, justext, jsonschema, jsonpatch, jinja2, httplib2, h2, griffe, googleapis-common-protos, google-auth, email-validator, courlan, cffi, blobfile, bleach, black, beautifulsoup4, asgi-lifespan, anyio, aiosignal, yake, wikipedia, tzlocal, torch, tiktoken, starlette, sqlmodel, rich, requests-oauthlib, prance, pendulum, openapi-schema-validator, marshmallow-enum, jsonschema-spec, huggingface-hub, httpcore, google-auth-httplib2, google-api-core, duckduckgo-search, docker, cryptography, croniter, alembic, aiohttp, transformers, torchvision, torchmetrics, openapi-spec-validator, openai, kubernetes, httpx, google-api-python-client, fastapi, dateparser, dataclasses-json, apprise, pytorch_lightning, langchain, htmldate, datamodel-code-generator, trafilatura, prefect, kandinsky2, marvin
DEPRECATION: sentencepiece is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at pypa/pip#8559
Running setup.py install for sentencepiece ... error
error: subprocess-exited-with-error

× Running setup.py install for sentencepiece did not run successfully.
│ exit code: 1
╰─> [89 lines of output]
running install
/Users/vitaliy/projects/python/marvin/venv/lib/python3.11/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build/lib.macosx-10.9-universal2-cpython-311
creating build/lib.macosx-10.9-universal2-cpython-311/sentencepiece
copying src/sentencepiece/init.py -> build/lib.macosx-10.9-universal2-cpython-311/sentencepiece
copying src/sentencepiece/_version.py -> build/lib.macosx-10.9-universal2-cpython-311/sentencepiece
copying src/sentencepiece/sentencepiece_model_pb2.py -> build/lib.macosx-10.9-universal2-cpython-311/sentencepiece
copying src/sentencepiece/sentencepiece_pb2.py -> build/lib.macosx-10.9-universal2-cpython-311/sentencepiece
running build_ext
Package sentencepiece was not found in the pkg-config search path.
Perhaps you should add the directory containing `sentencepiece.pc'
to the PKG_CONFIG_PATH environment variable
No package 'sentencepiece' found
Cloning into 'sentencepiece'...
Note: switching to '58f256cf6f01bb86e6fa634a5cc560de5bd1667d'.

  You are in 'detached HEAD' state. You can look around, make experimental
  changes and commit them, and you can discard any commits you make in this
  state without impacting any branches by switching back to a branch.
  
  If you want to create a new branch to retain commits you create, you may
  do so (now or later) by using -c with the switch command. Example:
  
    git switch -c <new-branch-name>
  
  Or undo this operation with:
  
    git switch -
  
  Turn off this advice by setting config variable advice.detachedHead to false
  
  ./build_bundled.sh: line 19: cmake: command not found
  ./build_bundled.sh: line 20: nproc: command not found
  ./build_bundled.sh: line 20: cmake: command not found
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/private/var/folders/dq/fs9xh36x1p5dsv1bwkckgb4r0000gn/T/pip-install-8nbbldo4/sentencepiece_721b978765ec4b9bad37a451b5799439/setup.py", line 136, in <module>
      setup(
    File "/Users/vitaliy/projects/python/marvin/venv/lib/python3.11/site-packages/setuptools/__init__.py", line 87, in setup
      return distutils.core.setup(**attrs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/Users/vitaliy/projects/python/marvin/venv/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 185, in setup
      return run_commands(dist)
             ^^^^^^^^^^^^^^^^^^
    File "/Users/vitaliy/projects/python/marvin/venv/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
      dist.run_commands()
    File "/Users/vitaliy/projects/python/marvin/venv/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 968, in run_commands
      self.run_command(cmd)
    File "/Users/vitaliy/projects/python/marvin/venv/lib/python3.11/site-packages/setuptools/dist.py", line 1217, in run_command
      super().run_command(command)
    File "/Users/vitaliy/projects/python/marvin/venv/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
      cmd_obj.run()
    File "/Users/vitaliy/projects/python/marvin/venv/lib/python3.11/site-packages/setuptools/command/install.py", line 68, in run
      return orig.install.run(self)
             ^^^^^^^^^^^^^^^^^^^^^^
    File "/Users/vitaliy/projects/python/marvin/venv/lib/python3.11/site-packages/setuptools/_distutils/command/install.py", line 698, in run
      self.run_command('build')
    File "/Users/vitaliy/projects/python/marvin/venv/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 319, in run_command
      self.distribution.run_command(command)
    File "/Users/vitaliy/projects/python/marvin/venv/lib/python3.11/site-packages/setuptools/dist.py", line 1217, in run_command
      super().run_command(command)
    File "/Users/vitaliy/projects/python/marvin/venv/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
      cmd_obj.run()
    File "/Users/vitaliy/projects/python/marvin/venv/lib/python3.11/site-packages/setuptools/_distutils/command/build.py", line 132, in run
      self.run_command(cmd_name)
    File "/Users/vitaliy/projects/python/marvin/venv/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 319, in run_command
      self.distribution.run_command(command)
    File "/Users/vitaliy/projects/python/marvin/venv/lib/python3.11/site-packages/setuptools/dist.py", line 1217, in run_command
      super().run_command(command)
    File "/Users/vitaliy/projects/python/marvin/venv/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
      cmd_obj.run()
    File "/Users/vitaliy/projects/python/marvin/venv/lib/python3.11/site-packages/setuptools/command/build_ext.py", line 84, in run
      _build_ext.run(self)
    File "/Users/vitaliy/projects/python/marvin/venv/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 346, in run
      self.build_extensions()
    File "/Users/vitaliy/projects/python/marvin/venv/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 466, in build_extensions
      self._build_extensions_serial()
    File "/Users/vitaliy/projects/python/marvin/venv/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 492, in _build_extensions_serial
      self.build_extension(ext)
    File "/private/var/folders/dq/fs9xh36x1p5dsv1bwkckgb4r0000gn/T/pip-install-8nbbldo4/sentencepiece_721b978765ec4b9bad37a451b5799439/setup.py", line 89, in build_extension
      subprocess.check_call(['./build_bundled.sh', __version__])
    File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 413, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['./build_bundled.sh', '0.1.97']' returned non-zero exit status 127.
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> sentencepiece

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
(venv) vitaliy@MacBook-Air marvin %

Bug with Kandinsky-2.0

image

Ошибка возникает, если попытаться запустить Kandinsky-2.0 для задачи img2img (ноутубук Kandinsky_2_0_img2img).
Видимо, сломалась обратная совместимость после обновления.

No module named cv2

I installed Kandinsky according to the instructions:

PS D:\> pip install "git+https://github.com/ai-forever/Kandinsky-2.0.git"
Collecting git+https://github.com/ai-forever/Kandinsky-2.0.git
  Cloning https://github.com/ai-forever/Kandinsky-2.0.git to c:\users\erel segal-halevi\appdata\local\temp\pip-req-build-o452dzak
  Running command git clone --filter=blob:none --quiet https://github.com/ai-forever/Kandinsky-2.0.git 'C:\Users\Erel Segal-Halevi\AppData\Local\Temp\pip-req-build-o452dzak'
  Resolved https://github.com/ai-forever/Kandinsky-2.0.git to commit 140d16db59d409f45f0e5ae755804ebe8f4b5a0a
  Preparing metadata (setup.py) ... done
Requirement already satisfied: Pillow in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from kandinsky2==0.0.0) (9.4.0)
Requirement already satisfied: attrs in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from kandinsky2==0.0.0) (22.2.0)
Requirement already satisfied: torch in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from kandinsky2==0.0.0) (1.13.1)
Requirement already satisfied: filelock in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from kandinsky2==0.0.0) (3.9.0)
Requirement already satisfied: requests in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from kandinsky2==0.0.0) (2.28.2)
Requirement already satisfied: tqdm in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from kandinsky2==0.0.0) (4.64.1)
Requirement already satisfied: ftfy in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from kandinsky2==0.0.0) (6.1.1)
Requirement already satisfied: regex in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from kandinsky2==0.0.0) (2022.10.31)
Requirement already satisfied: numpy in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from kandinsky2==0.0.0) (1.24.2)
Requirement already satisfied: blobfile in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from kandinsky2==0.0.0) (2.0.1)
Requirement already satisfied: transformers==4.23.1 in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from kandinsky2==0.0.0) (4.23.1)
Requirement already satisfied: torchvision in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from kandinsky2==0.0.0) (0.14.1)
Requirement already satisfied: omegaconf in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from kandinsky2==0.0.0) (2.3.0)
Requirement already satisfied: pytorch_lightning in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from kandinsky2==0.0.0) (1.9.3)
Requirement already satisfied: einops in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from kandinsky2==0.0.0) (0.6.0)
Requirement already satisfied: sentencepiece in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from kandinsky2==0.0.0) (0.1.97)
Requirement already satisfied: tokenizers!=0.11.3,<0.14,>=0.11.1 in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from transformers==4.23.1->kandinsky2==0.0.0) (0.13.2)
Requirement already satisfied: huggingface-hub<1.0,>=0.10.0 in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from transformers==4.23.1->kandinsky2==0.0.0) (0.12.1)
Requirement already satisfied: packaging>=20.0 in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from transformers==4.23.1->kandinsky2==0.0.0) (23.0)
Requirement already satisfied: pyyaml>=5.1 in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from transformers==4.23.1->kandinsky2==0.0.0) (6.0)
Requirement already satisfied: colorama in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from tqdm->kandinsky2==0.0.0) (0.4.6)
Requirement already satisfied: lxml~=4.9 in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from blobfile->kandinsky2==0.0.0) (4.9.2)
Requirement already satisfied: pycryptodomex~=3.8 in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from blobfile->kandinsky2==0.0.0) (3.17)
Requirement already satisfied: urllib3<3,>=1.25.3 in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from blobfile->kandinsky2==0.0.0) (1.26.14)
Requirement already satisfied: wcwidth>=0.2.5 in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from ftfy->kandinsky2==0.0.0) (0.2.6)
Requirement already satisfied: antlr4-python3-runtime==4.9.* in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from omegaconf->kandinsky2==0.0.0) (4.9.3)
Requirement already satisfied: torchmetrics>=0.7.0 in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from pytorch_lightning->kandinsky2==0.0.0) (0.11.3)
Requirement already satisfied: fsspec[http]>2021.06.0 in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from pytorch_lightning->kandinsky2==0.0.0) (2023.1.0)
Requirement already satisfied: lightning-utilities>=0.6.0.post0 in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from pytorch_lightning->kandinsky2==0.0.0) (0.7.1)
Requirement already satisfied: typing-extensions>=4.0.0 in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from pytorch_lightning->kandinsky2==0.0.0) (4.5.0)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from requests->kandinsky2==0.0.0) (2022.12.7)
Requirement already satisfied: charset-normalizer<4,>=2 in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from requests->kandinsky2==0.0.0) (3.0.1)
Requirement already satisfied: idna<4,>=2.5 in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from requests->kandinsky2==0.0.0) (3.4)
Requirement already satisfied: aiohttp!=4.0.0a0,!=4.0.0a1 in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from fsspec[http]>2021.06.0->pytorch_lightning->kandinsky2==0.0.0) (3.8.4)
Requirement already satisfied: aiosignal>=1.1.2 in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from aiohttp!=4.0.0a0,!=4.0.0a1->fsspec[http]>2021.06.0->pytorch_lightning->kandinsky2==0.0.0) (1.3.1)
Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from aiohttp!=4.0.0a0,!=4.0.0a1->fsspec[http]>2021.06.0->pytorch_lightning->kandinsky2==0.0.0) (4.0.2)
Requirement already satisfied: yarl<2.0,>=1.0 in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from aiohttp!=4.0.0a0,!=4.0.0a1->fsspec[http]>2021.06.0->pytorch_lightning->kandinsky2==0.0.0) (1.8.2)
Requirement already satisfied: frozenlist>=1.1.1 in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from aiohttp!=4.0.0a0,!=4.0.0a1->fsspec[http]>2021.06.0->pytorch_lightning->kandinsky2==0.0.0) (1.3.3)
Requirement already satisfied: multidict<7.0,>=4.5 in c:\users\erel segal-halevi\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from aiohttp!=4.0.0a0,!=4.0.0a1->fsspec[http]>2021.06.0->pytorch_lightning->kandinsky2==0.0.0) (6.0.4)

Then I tried to import it in Python but got an error:

PS D:\> python
Python 3.10.10 (tags/v3.10.10:aad5f6a, Feb  7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from kandinsky2 import get_kandinsky2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Erel Segal-Halevi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\kandinsky2\__init__.py", line 2, in <module>
    from .kandinsky2_model import Kandinsky2
  File "C:\Users\Erel Segal-Halevi\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\kandinsky2\kandinsky2_model.py", line 4, in <module>
    import cv2
ModuleNotFoundError: No module named 'cv2'

Unable to use `batch_size`>1 in inpainting mode

The title pretty much speaks for itself. Calling .generate_inpainting(...) with batch_size higher than 1 throws an error.

Log:

[/usr/local/lib/python3.9/dist-packages/kandinsky2/model/text2im_model2_1.py](https://localhost:8080/#) in forward(self, x, timesteps, inpaint_image, inpaint_mask, **kwargs)
    150             inpaint_mask = torch.zeros_like(x[:, :1])
    151         return super().forward(
--> 152             torch.cat([x, inpaint_image * inpaint_mask, inpaint_mask], dim=1),
    153             timesteps,
    154             **kwargs,

RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 4 but got size 2 for tensor number 1 in the list.```

Fine tuning

Как эту модель fine tune'ить? Можно ли? Если нет - прошу добавить.

Is any particular version of CUDA required? "torch.cuda.is_available() is False"

On startup, it doesn't seem to see the CUDA system install. With projects in other environments, everything works fine on it. Is any particular version of CUDA required?

The system (Win 11) has the latest version of CUDA 12.1 installed. Kandinsky2 installed in a new environment:

conda:
  - python=3.10.10
pip:
  - opencv-python
  - git+https://github.com/openai/CLIP.git
  - git+https://github.com/ai-forever/Kandinsky-2.git

In response to:

from kandinsky2 import get_kandinsky2
model = get_kandinsky2('cuda', task_type='text2img', model_version='2.1', use_flash_attention=False)

Throws an error:

Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU.

Плагин Kandinsky 2.0 для AUTOMATIC1111

Здравствуйте! Очень хочется увидеть Kandinsky 2.0 в формате плагина для AUTOMATIC1111 и других популярных интерфейсов Stable Diffusion (ComfyUI, InvokeAI, Easy Diffusion . . .).
Буду очень признателен, если вы это реализуете 😊

Nvidia Cuda with 8GB of RAM gives out of memory error

How do I have to modify the settings so that it runs on my RTX3060ti card, because now I get OOM?
It is a 8GB Nvidia Card, capable to run CUDA.

I'm calling Kandinsky with this script: https://gist.github.com/DanPli/0bfcaed38ed678adf3cd3f6aa0420f46

I get the following errors:

(venv) G:\k\Kandinsky>gen.py --prompt "green car"
G:\k\Kandinsky\venv\lib\site-packages\huggingface_hub\file_download.py:637: FutureWarning: cached_download is the legacy way to download files from the HF hub, please consider upgrading to hf_hub_download
warnings.warn(
making attention of type 'vanilla' with 512 in_channels
making attention of type 'vanilla' with 512 in_channels
making attention of type 'vanilla' with 512 in_channels
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
0%| | 0/30 [00:01<?, ?it/s]
Traceback (most recent call last):
File "G:\k\Kandinsky\gen.py", line 66, in
generate(**vars(parser.parse_args()))
File "G:\k\Kandinsky\gen.py", line 34, in generate
images = model.generate_text2img(
File "G:\k\Kandinsky\venv\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "G:\k\Kandinsky\venv\lib\site-packages\kandinsky2\kandinsky2_1_model.py", line 341, in generate_text2img return self.generate_img(
File "G:\k\Kandinsky\venv\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "G:\k\Kandinsky\venv\lib\site-packages\kandinsky2\kandinsky2_1_model.py", line 247, in generate_img
samples = diffusion.p_sample_loop(
File "G:\k\Kandinsky\venv\lib\site-packages\kandinsky2\model\gaussian_diffusion.py", line 413, in p_sample_loop
for sample in self.p_sample_loop_progressive(
File "G:\k\Kandinsky\venv\lib\site-packages\kandinsky2\model\gaussian_diffusion.py", line 466, in p_sample_loop_progressive
out = self.p_sample(
File "G:\k\Kandinsky\venv\lib\site-packages\kandinsky2\model\gaussian_diffusion.py", line 369, in p_sample
out = self.p_mean_variance(
File "G:\k\Kandinsky\venv\lib\site-packages\kandinsky2\model\respace.py", line 102, in p_mean_variance
return super().p_mean_variance(self._wrap_model(model), *args, **kwargs)
File "G:\k\Kandinsky\venv\lib\site-packages\kandinsky2\model\gaussian_diffusion.py", line 251, in p_mean_variance
model_output = model(x, s_t, **model_kwargs)
File "G:\k\Kandinsky\venv\lib\site-packages\kandinsky2\model\respace.py", line 133, in call
return self.model(x, new_ts, **kwargs)
File "G:\k\Kandinsky\venv\lib\site-packages\kandinsky2\kandinsky2_1_model.py", line 225, in model_fn
model_out = self.model(combined, ts, **kwargs)
File "G:\k\Kandinsky\venv\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "G:\k\Kandinsky\venv\lib\site-packages\kandinsky2\model\text2im_model2_1.py", line 95, in forward
h = module(h, emb, xf_out)
File "G:\k\Kandinsky\venv\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "G:\k\Kandinsky\venv\lib\site-packages\kandinsky2\model\unet.py", line 42, in forward
x = layer(x, encoder_out)
File "G:\k\Kandinsky\venv\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "G:\k\Kandinsky\venv\lib\site-packages\kandinsky2\model\unet.py", line 265, in forward
h = self.attention(qkv, encoder_out)
File "G:\k\Kandinsky\venv\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "G:\k\Kandinsky\venv\lib\site-packages\kandinsky2\model\unet.py", line 338, in forward
weight = torch.softmax(weight.float(), dim=-1).type(weight.dtype)
torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 506.00 MiB (GPU 0; 8.00 GiB total capacity; 6.83 GiB already allocated; 0 bytes free; 6.95 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

threading

Hi, I have a problem with threading the model generate similar images. where does the race condition happen? i
for now I know it happened when calling generate_img function in class Kandinsky2_1.

CUDA support

How can run it on machine without Nvidia Graphics Card?

Use CUDA

Привет!)

Почему то при генерации изображения получаю ошибку:

raise RuntimeError('Attempting to deserialize object on a CUDA '

RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU.

Как мне решить эту проблему? У меня комп с видеокартой, драйвера cuda стоят

T5Converter requires the protobuf library

I installed Kandinsky and ran model = get_kandinsky2('cuda', task_type='text2img'), and got the following error:

ImportError: 
T5Converter requires the protobuf library but it was not found in your environment. Checkout the instructions on the
installation page of its repo: https://github.com/protocolbuffers/protobuf/tree/master/python#installation and follow the ones
that match your environment.

I entered this link, but got confused by the multitude of options. I have Windows 11 - can you tell me what exactly I need in order to run Kandinsky?

libGL.so.1: no such file or directory

I installed Kandinskiy on an Ubuntu 22.04 machine using WIndows-Subsystem-Linux. When I tried to import it, I got an error:

>>> from kandinsky2 import get_kandinsky2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.10/dist-packages/kandinsky2/__init__.py", line 2, in <module>
    from .kandinsky2_model import Kandinsky2
  File "/usr/local/lib/python3.10/dist-packages/kandinsky2/kandinsky2_model.py", line 4, in <module>
    import cv2
  File "/usr/local/lib/python3.10/dist-packages/cv2/__init__.py", line 181, in <module>
    bootstrap()
  File "/usr/local/lib/python3.10/dist-packages/cv2/__init__.py", line 153, in bootstrap
    native_module = importlib.import_module("cv2")
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: libGL.so.1: cannot open shared object file: No such file or directory

side by side comparison against other alternatives?

hi guys, first of all great work! two questions

  1. can I safely say Kandinsky works best with Russian, meanwhile also working with English and potentially other languages? i.e. Russian > English > others?
  2. im trying to evaluate kandinsky 2.1 vs. alternatives. I wonder if there is already some benchmark sheet, e.g. how different models on the same prompt perform.

thx a lot!

Add setup script and txt2img generation script for ease of use

For windows users and nvidia GPU:
You need to have Python (3.10) installed as well as git.

Scripts: https://gist.github.com/DanPli/98c05281a749254e5b572238825d3617 and https://gist.github.com/DanPli/0bfcaed38ed678adf3cd3f6aa0420f46

Edit: Here is a simple inpainting script: https://gist.github.com/DanPli/bce1fac71c2bdef0252d70b682808faa see comment #33 (comment)

I created the setup batch file to setup kandinsky-2 for myself, but perhaps someone finds it useful. Installs Kandinsky with torch 2.0 and cudnn118 as well as the other dependencies. Create a folder, place the files inside and run the setup_kandinsky.bat to do the installation.

The gen.py is based on https://gist.github.com/Blucknote/31f792621f4e4cdf0a7d2505ddd6b0a2 mostly changing the image saving method and naming to avoid windows OS invalid file naming issues, resulting in errors. Thank you, user Blucknote.

and after all the dependencies are installed you can use the gen.py to generate images. FYI, on the first run, the model will be downloaded from the huggingface hub.

To use the txt2img generator file, open a powershell/cmd shell window in the folder, activate the venv with
" .\venv\Scripts\activate "

With the venv active:

Example usage:
python.exe gen.py --prompt 1girl --negative_prompt "ugly, bad anatomy" --steps 50

Put prompts and negatives in quotes if there is more than one word (spaces, special characters etc.)
Other commands you can pass to the gen.py:
[--prompt PROMPT] [--negative_prompt NEGATIVE_PROMPT] [--steps STEPS] [--batch BATCH]
[--scale SCALE] [--height HEIGHT] [--width WIDTH] [--sampler SAMPLER]
[--prior_scale PRIOR_SCALE] [--prior_steps PRIOR_STEPS]

Generated images will be placed in a subfolder "generated_images" with date and numbering naming convention and in png format by default.

CUDA out of memory

При запуске пример

from kandinsky2 import get_kandinsky2
model = get_kandinsky2('cuda', task_type='text2img', model_version='2.1', use_flash_attention=False)
images = model.generate_text2img(
    "red cat, 4k photo", 
    num_steps=100,
    batch_size=1, 
    guidance_scale=4,
    h=768, w=768,
    sampler='p_sampler', 
    prior_cf_scale=4,
    prior_steps="5"
)

Возникает ошибка. Кто-нибудь сталкивался с этим?

CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 10.76 GiB total capacity; 7.06 GiB already allocated; 8.81 MiB free; 7.15 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

Не работает на CPU

Code to reproduce:

from kandinsky2 import get_kandinsky2

model = get_kandinsky2('cpu', task_type='text2img', cache_dir='/tmp/kandinsky2', model_version='2.1', use_flash_attention=False)
images = model.generate_text2img("red cat, 4k photo", num_steps=100, batch_size=1, guidance_scale=4, h=256, w=256, sampler='p_sampler', prior_cf_scale=4, prior_steps="5")

error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/xxx/.local/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "/home/xxx/.local/lib/python3.8/site-packages/kandinsky2/kandinsky2_1_model.py", line 315, in generate_text2img
    image_emb = self.generate_clip_emb(
  File "/home/xxx/.local/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "/home/michael/.local/lib/python3.8/site-packages/kandinsky2/kandinsky2_1_model.py", line 168, in generate_clip_emb
    img_feat = self.prior(
  File "/home/xxx/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/xxx/.local/lib/python3.8/site-packages/kandinsky2/model/prior.py", line 373, in forward
    sample = sample_fn(
  File "/home/xxx/.local/lib/python3.8/site-packages/kandinsky2/model/gaussian_diffusion.py", line 413, in p_sample_loop
    for sample in self.p_sample_loop_progressive(
  File "/home/xxx/.local/lib/python3.8/site-packages/kandinsky2/model/gaussian_diffusion.py", line 466, in p_sample_loop_progressive
    out = self.p_sample(
  File "/home/xxx/.local/lib/python3.8/site-packages/kandinsky2/model/gaussian_diffusion.py", line 369, in p_sample
    out = self.p_mean_variance(
  File "/home/xxx/.local/lib/python3.8/site-packages/kandinsky2/model/respace.py", line 102, in p_mean_variance
    return super().p_mean_variance(self._wrap_model(model), *args, **kwargs)
  File "/home/xxx/.local/lib/python3.8/site-packages/kandinsky2/model/gaussian_diffusion.py", line 251, in p_mean_variance
    model_output = model(x, s_t, **model_kwargs)
  File "/home/xxx/.local/lib/python3.8/site-packages/kandinsky2/model/respace.py", line 133, in __call__
    return self.model(x, new_ts, **kwargs)
  File "/home/xxx/.local/lib/python3.8/site-packages/kandinsky2/model/prior.py", line 354, in guided_model_fn
    model_out = self.model(combined, ts, **kwargs)
  File "/home/xxx/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/xxx/.local/lib/python3.8/site-packages/kandinsky2/model/prior.py", line 240, in forward
    t_emb = self.time_embed(
  File "/home/xxx/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/xxx/.local/lib/python3.8/site-packages/torch/nn/modules/container.py", line 204, in forward
    input = module(input)
  File "/home/xxx/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/xxx/.local/lib/python3.8/site-packages/torch/nn/modules/linear.py", line 114, in forward
    return F.linear(input, self.weight, self.bias)
RuntimeError: "addmm_impl_cpu_" not implemented for 'Half'

Finetune

У вас в репозитории есть пара файлов с train префиксом. А можно пример дооубения какой-то - формат датасета, примеры входа выхода.

Add helpful installation information to README

Right now it's only a pip command to install kadinsky but not a word about clip or opencv. Probably should be something like this:

pip install opencv-python
pip install git+https://github.com/openai/CLIP.git
pip install git+https://github.com/ai-forever/Kandinsky-2.git

Vulkan

Подрерживаются карты от AMD ?

Please note the very inattentive attitude towards Kandinsky 2.1

Dear AI Forever why have you removed the link to the blog on the hubr site.

Also your google colab laptop does not work as there is no access to your model.

Honestly expected more and ended up with a lot of bugs and limitations.

Really hope you at least respond in some way, or better yet fix the problems. For it is impossible to work with what you present. That's how it is!

About some practice details

Hi,

It is very cool and inspiring work. I have some questions about practice details and hope you can help me out.

a. The first one is why change the time embedding ( line 83, model/text2im_model.py)? I haven't seen the same operation in another diffusion-based work and wondering about the goal.
b. Do the function of the linear layer in Text2ImUNet align the distribution of two text embeddings?
It would be grateful if you could release the training details.

Many thanks

what to do if i have amd gpu?

я не знаю почему но когда пытаюсь сгенерировать картинку поучаю следующею ошибку:
RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU.
но вроде в интернете написано что амд и нвидиа не совместимы но я смог установить cuda отменив установку драйверов и интеграции с VS(по-другому не получалось). но я использую VS так что я не очень понимаю что делать для решения данной проблемы.

Как избавиться от генерации лишних пальцев на руках ?

kandinsky-download-1680392468662
Здравствуйте, портреты, пейзажи, натюрморты, делаются на отлично, но когда дело касается людей - видимо я что-то не то делаю. Можно ли как-то избавиться от этого эффекта ? Может надо специально указать число пальцев на руке ?

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.