Spaces:
Sleeping
Sleeping
Update app.py
Browse filesДобавлена возможность выбора LoRA PussInBoots
60 unmodified lines6162636465666741 unmodified lines10911011111211311411511660 unmodified linesmodel_id_default = "sd-legacy/stable-diffusion-v1-5"model_dropdown = ['stabilityai/sdxl-turbo', 'CompVis/stable-diffusion-v1-4', 'sd-legacy/stable-diffusion-v1-5' ]model_lora_default = "lora_lady_and_cats_logos"model_lora_dropdown = ['lora_lady_and_cats_logos', 'lora_pussinboots_logos' ]if torch.cuda.is_available():41 unmodified linesprompt_embeds, negative_prompt_embeds = align_embeddings(prompt_embeds, negative_prompt_embeds)else:# добавляем lorapipe = get_lora_sd_pipeline(ckpt_dir='./lora_lady_and_cats_logos', base_model_name_or_path=model_id_default, dtype=torch_dtype).to(device)#pipe = get_lora_sd_pipeline(ckpt_dir='./'+model_lora_id, base_model_name_or_path=model_id_default, dtype=torch_dtype).to(device)prompt_embeds = process_prompt(prompt, pipe.tokenizer, pipe.text_encoder)negative_prompt_embeds = process_prompt(negative_prompt, pipe.tokenizer, pipe.text_encoder)prompt_embeds, negative_prompt_embeds = align_embeddings(prompt_embeds, negative_prompt_embeds)60 unmodified lines6162636465666741 unmodified lines10911011111211311411511660 unmodified linesmodel_id_default = "sd-legacy/stable-diffusion-v1-5"model_dropdown = ['stabilityai/sdxl-turbo', 'CompVis/stable-diffusion-v1-4', 'sd-legacy/stable-diffusion-v1-5' ]model_lora_default = "lora_pussinboots_logos"model_lora_dropdown = ['lora_lady_and_cats_logos', 'lora_pussinboots_logos' ]if torch.cuda.is_available():41 unmodified linesprompt_embeds, negative_prompt_embeds = align_embeddings(prompt_embeds, negative_prompt_embeds)else:# добавляем lora#pipe = get_lora_sd_pipeline(ckpt_dir='./lora_lady_and_cats_logos', base_model_name_or_path=model_id_default, dtype=torch_dtype).to(device)pipe = get_lora_sd_pipeline(ckpt_dir='./'+model_lora_id, base_model_name_or_path=model_id_default, dtype=torch_dtype).to(device)prompt_embeds = process_prompt(prompt, pipe.tokenizer, pipe.text_encoder)negative_prompt_embeds = process_prompt(negative_prompt, pipe.tokenizer, pipe.text_encoder)prompt_embeds, negative_prompt_embeds = align_embeddings(prompt_embeds, negative_prompt_embeds)
app.py+3-3