update: remove refiner
Browse files
app.py
CHANGED
@@ -22,22 +22,22 @@ if gr.NO_RELOAD:
|
|
22 |
variant="fp16",
|
23 |
use_safetensors=True,
|
24 |
)
|
25 |
-
refiner = DiffusionPipeline.from_pretrained(
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
)
|
33 |
pipeline = I2VGenXLPipeline.from_pretrained("ali-vilab/i2vgen-xl", torch_dtype=torch.float16, variant="fp16")
|
34 |
|
35 |
base.to("cuda")
|
36 |
-
refiner.to("cuda")
|
37 |
pipeline.to("cuda")
|
38 |
|
39 |
base.unet = torch.compile(base.unet, mode="reduce-overhead", fullgraph=True)
|
40 |
-
refiner.unet = torch.compile(refiner.unet, mode="reduce-overhead", fullgraph=True)
|
41 |
pipeline.unet = torch.compile(pipeline.unet, mode="reduce-overhead", fullgraph=True)
|
42 |
|
43 |
def generate(prompt: str, progress=gr.Progress()):
|
@@ -55,18 +55,18 @@ def generate(prompt: str, progress=gr.Progress()):
|
|
55 |
),
|
56 |
).images[0]
|
57 |
progress((n_sdxl_steps * high_noise_frac, total_steps), desc="Refining first frame...")
|
58 |
-
image = refiner(
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
).images[0]
|
70 |
image = to_tensor(image)
|
71 |
progress((n_sdxl_steps, total_steps), desc="Generating video...")
|
72 |
frames: list[Image.Image] = pipeline(
|
|
|
22 |
variant="fp16",
|
23 |
use_safetensors=True,
|
24 |
)
|
25 |
+
# refiner = DiffusionPipeline.from_pretrained(
|
26 |
+
# "stabilityai/stable-diffusion-xl-refiner-1.0",
|
27 |
+
# text_encoder_2=base.text_encoder_2,
|
28 |
+
# vae=base.vae,
|
29 |
+
# torch_dtype=torch.float16,
|
30 |
+
# use_safetensors=True,
|
31 |
+
# variant="fp16",
|
32 |
+
# )
|
33 |
pipeline = I2VGenXLPipeline.from_pretrained("ali-vilab/i2vgen-xl", torch_dtype=torch.float16, variant="fp16")
|
34 |
|
35 |
base.to("cuda")
|
36 |
+
# refiner.to("cuda")
|
37 |
pipeline.to("cuda")
|
38 |
|
39 |
base.unet = torch.compile(base.unet, mode="reduce-overhead", fullgraph=True)
|
40 |
+
# refiner.unet = torch.compile(refiner.unet, mode="reduce-overhead", fullgraph=True)
|
41 |
pipeline.unet = torch.compile(pipeline.unet, mode="reduce-overhead", fullgraph=True)
|
42 |
|
43 |
def generate(prompt: str, progress=gr.Progress()):
|
|
|
55 |
),
|
56 |
).images[0]
|
57 |
progress((n_sdxl_steps * high_noise_frac, total_steps), desc="Refining first frame...")
|
58 |
+
# image = refiner(
|
59 |
+
# prompt=prompt,
|
60 |
+
# num_inference_steps=n_sdxl_steps,
|
61 |
+
# denoising_start=high_noise_frac,
|
62 |
+
# image=image,
|
63 |
+
# callback_on_step_end=create_progress_updater(
|
64 |
+
# start=n_sdxl_steps * high_noise_frac,
|
65 |
+
# total=total_steps,
|
66 |
+
# desc="Refining first frame...",
|
67 |
+
# progress=progress,
|
68 |
+
# ),
|
69 |
+
# ).images[0]
|
70 |
image = to_tensor(image)
|
71 |
progress((n_sdxl_steps, total_steps), desc="Generating video...")
|
72 |
frames: list[Image.Image] = pipeline(
|