Fabrice-TIERCELIN
commited on
Commit
•
eb4913f
1
Parent(s):
8bfb7fd
parser.add_argument("--use_tile_vae", action='store_true', default=False)#False
Browse files
app.py
CHANGED
@@ -8,8 +8,6 @@ import numpy as np
|
|
8 |
import torch
|
9 |
from SUPIR.util import create_SUPIR_model, load_QF_ckpt
|
10 |
from PIL import Image
|
11 |
-
from llava.llava_agent import LLavaAgent
|
12 |
-
from CKPT_PTH import LLAVA_MODEL_PATH
|
13 |
import einops
|
14 |
import copy
|
15 |
import math
|
@@ -32,7 +30,7 @@ parser.add_argument("--no_llava", action='store_true', default=True)#False
|
|
32 |
parser.add_argument("--use_image_slider", action='store_true', default=False)#False
|
33 |
parser.add_argument("--log_history", action='store_true', default=False)
|
34 |
parser.add_argument("--loading_half_params", action='store_true', default=False)#False
|
35 |
-
parser.add_argument("--use_tile_vae", action='store_true', default=
|
36 |
parser.add_argument("--encoder_tile_size", type=int, default=512)
|
37 |
parser.add_argument("--decoder_tile_size", type=int, default=64)
|
38 |
parser.add_argument("--load_8bit_llava", action='store_true', default=False)
|
@@ -60,12 +58,7 @@ if torch.cuda.device_count() > 0:
|
|
60 |
model.first_stage_model.denoise_encoder_s1 = copy.deepcopy(model.first_stage_model.denoise_encoder)
|
61 |
model.current_model = 'v0-Q'
|
62 |
ckpt_Q, ckpt_F = load_QF_ckpt(args.opt)
|
63 |
-
|
64 |
-
# load LLaVA
|
65 |
-
if use_llava:
|
66 |
-
llava_agent = LLavaAgent(LLAVA_MODEL_PATH, device=LLaVA_device, load_8bit=args.load_8bit_llava, load_4bit=False)
|
67 |
-
else:
|
68 |
-
llava_agent = None
|
69 |
|
70 |
def check_upload(input_image):
|
71 |
if input_image is None:
|
|
|
8 |
import torch
|
9 |
from SUPIR.util import create_SUPIR_model, load_QF_ckpt
|
10 |
from PIL import Image
|
|
|
|
|
11 |
import einops
|
12 |
import copy
|
13 |
import math
|
|
|
30 |
parser.add_argument("--use_image_slider", action='store_true', default=False)#False
|
31 |
parser.add_argument("--log_history", action='store_true', default=False)
|
32 |
parser.add_argument("--loading_half_params", action='store_true', default=False)#False
|
33 |
+
parser.add_argument("--use_tile_vae", action='store_true', default=False)#False
|
34 |
parser.add_argument("--encoder_tile_size", type=int, default=512)
|
35 |
parser.add_argument("--decoder_tile_size", type=int, default=64)
|
36 |
parser.add_argument("--load_8bit_llava", action='store_true', default=False)
|
|
|
58 |
model.first_stage_model.denoise_encoder_s1 = copy.deepcopy(model.first_stage_model.denoise_encoder)
|
59 |
model.current_model = 'v0-Q'
|
60 |
ckpt_Q, ckpt_F = load_QF_ckpt(args.opt)
|
61 |
+
llava_agent = None
|
|
|
|
|
|
|
|
|
|
|
62 |
|
63 |
def check_upload(input_image):
|
64 |
if input_image is None:
|