ai-forever/Kandinsky-2

UnboundLocalError: local variable 'config_file_url' referenced before assignment

MohamedAliRashad opened this issue · 1 comments

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)

There is no such task type img2img (yet?) in Kandinsky2.1

if task_type == "text2img":
model_name = "decoder_fp16.ckpt"
config_file_url = hf_hub_url(repo_id="sberbank-ai/Kandinsky_2.1", filename=model_name)
elif task_type == "inpainting":
model_name = "inpainting_fp16.ckpt"
config_file_url = hf_hub_url(repo_id="sberbank-ai/Kandinsky_2.1", filename=model_name)

But there another way mentioned in #22: #22 (comment)