zhiweili
commited on
Commit
·
0577725
1
Parent(s):
ec80eac
test hidiffusion
Browse files- inversion_run_base.py +6 -2
- requirements.txt +2 -1
inversion_run_base.py
CHANGED
@@ -2,7 +2,7 @@ import torch
|
|
2 |
|
3 |
from diffusers import (
|
4 |
DDPMScheduler,
|
5 |
-
|
6 |
)
|
7 |
from diffusers.pipelines.stable_diffusion_xl.pipeline_stable_diffusion_xl_img2img import retrieve_timesteps, retrieve_latents
|
8 |
from PIL import Image
|
@@ -11,6 +11,8 @@ from config import get_config, get_num_steps_actual
|
|
11 |
from functools import partial
|
12 |
from compel import Compel, ReturnedEmbeddingsType
|
13 |
|
|
|
|
|
14 |
class Object(object):
|
15 |
pass
|
16 |
|
@@ -42,7 +44,7 @@ device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
42 |
BASE_MODEL = "stabilityai/sdxl-turbo"
|
43 |
|
44 |
|
45 |
-
pipeline =
|
46 |
BASE_MODEL,
|
47 |
torch_dtype=torch.float16,
|
48 |
variant="fp16",
|
@@ -55,6 +57,8 @@ pipeline.scheduler = DDPMScheduler.from_pretrained(
|
|
55 |
subfolder="scheduler",
|
56 |
)
|
57 |
|
|
|
|
|
58 |
config = get_config(args)
|
59 |
|
60 |
compel_proc = Compel(
|
|
|
2 |
|
3 |
from diffusers import (
|
4 |
DDPMScheduler,
|
5 |
+
AutoPipelineForImage2Image,
|
6 |
)
|
7 |
from diffusers.pipelines.stable_diffusion_xl.pipeline_stable_diffusion_xl_img2img import retrieve_timesteps, retrieve_latents
|
8 |
from PIL import Image
|
|
|
11 |
from functools import partial
|
12 |
from compel import Compel, ReturnedEmbeddingsType
|
13 |
|
14 |
+
from hidiffusion import apply_hidiffusion, remove_hidiffusion
|
15 |
+
|
16 |
class Object(object):
|
17 |
pass
|
18 |
|
|
|
44 |
BASE_MODEL = "stabilityai/sdxl-turbo"
|
45 |
|
46 |
|
47 |
+
pipeline = AutoPipelineForImage2Image.from_pretrained(
|
48 |
BASE_MODEL,
|
49 |
torch_dtype=torch.float16,
|
50 |
variant="fp16",
|
|
|
57 |
subfolder="scheduler",
|
58 |
)
|
59 |
|
60 |
+
apply_hidiffusion(pipeline)
|
61 |
+
|
62 |
config = get_config(args)
|
63 |
|
64 |
compel_proc = Compel(
|
requirements.txt
CHANGED
@@ -14,4 +14,5 @@ git+https://github.com/XPixelGroup/BasicSR@master
|
|
14 |
facexlib
|
15 |
realesrgan
|
16 |
controlnet_aux
|
17 |
-
peft
|
|
|
|
14 |
facexlib
|
15 |
realesrgan
|
16 |
controlnet_aux
|
17 |
+
peft
|
18 |
+
hidiffusion
|