Spaces:
Runtime error
Runtime error
- scripts/anime.py +0 -2
- scripts/generate_prompt.py +0 -2
- scripts/process_utils.py +2 -5
scripts/anime.py
CHANGED
@@ -14,8 +14,6 @@ from kornia.enhance import equalize_clahe
|
|
14 |
from PIL import Image
|
15 |
import numpy as np
|
16 |
|
17 |
-
import spaces
|
18 |
-
|
19 |
model = None
|
20 |
device = None
|
21 |
|
|
|
14 |
from PIL import Image
|
15 |
import numpy as np
|
16 |
|
|
|
|
|
17 |
model = None
|
18 |
device = None
|
19 |
|
scripts/generate_prompt.py
CHANGED
@@ -10,8 +10,6 @@ from tensorflow.keras.layers import TFSMLayer
|
|
10 |
from huggingface_hub import hf_hub_download
|
11 |
from pathlib import Path
|
12 |
|
13 |
-
import spaces
|
14 |
-
|
15 |
# 画像サイズの設定
|
16 |
IMAGE_SIZE = 448
|
17 |
|
|
|
10 |
from huggingface_hub import hf_hub_download
|
11 |
from pathlib import Path
|
12 |
|
|
|
|
|
13 |
# 画像サイズの設定
|
14 |
IMAGE_SIZE = 448
|
15 |
|
scripts/process_utils.py
CHANGED
@@ -10,12 +10,9 @@ from scripts.anime import init_model
|
|
10 |
import torch
|
11 |
from diffusers import StableDiffusionPipeline, StableDiffusionControlNetPipeline, ControlNetModel, UniPCMultistepScheduler, AutoencoderKL
|
12 |
import gc
|
13 |
-
from peft import PeftModel
|
14 |
from dotenv import load_dotenv
|
15 |
from scripts.hf_utils import download_file
|
16 |
|
17 |
-
import spaces
|
18 |
-
|
19 |
# グローバル変数
|
20 |
use_local = False
|
21 |
model = None
|
@@ -46,9 +43,9 @@ def initialize(_use_local=False, use_gpu=False, use_dotenv=False):
|
|
46 |
print(f"\nDevice: {device}, Local model: {_use_local}\n")
|
47 |
|
48 |
init_model(use_local)
|
49 |
-
|
50 |
sotai_gen_pipe = initialize_sotai_model()
|
51 |
-
|
52 |
|
53 |
def load_lora(pipeline, lora_path, adapter_name, alpha=0.75):
|
54 |
pipeline.load_lora_weights(lora_path, adapter_name)
|
|
|
10 |
import torch
|
11 |
from diffusers import StableDiffusionPipeline, StableDiffusionControlNetPipeline, ControlNetModel, UniPCMultistepScheduler, AutoencoderKL
|
12 |
import gc
|
|
|
13 |
from dotenv import load_dotenv
|
14 |
from scripts.hf_utils import download_file
|
15 |
|
|
|
|
|
16 |
# グローバル変数
|
17 |
use_local = False
|
18 |
model = None
|
|
|
43 |
print(f"\nDevice: {device}, Local model: {_use_local}\n")
|
44 |
|
45 |
init_model(use_local)
|
46 |
+
model = load_wd14_tagger_model()
|
47 |
sotai_gen_pipe = initialize_sotai_model()
|
48 |
+
refine_gen_pipe = initialize_refine_model()
|
49 |
|
50 |
def load_lora(pipeline, lora_path, adapter_name, alpha=0.75):
|
51 |
pipeline.load_lora_weights(lora_path, adapter_name)
|