zhiweili
commited on
Commit
Β·
452f3b5
1
Parent(s):
f023e9e
add init image
Browse files- app_tensorrt.py +3 -1
app_tensorrt.py
CHANGED
@@ -7,6 +7,7 @@ from diffusers import (
|
|
7 |
DDPMScheduler,
|
8 |
StableDiffusionXLImg2ImgPipeline,
|
9 |
AutoencoderKL,
|
|
|
10 |
)
|
11 |
|
12 |
os.system("pip install torch_tensorrt==2.4.0")
|
@@ -48,8 +49,9 @@ compiledModel = torch.compile(
|
|
48 |
|
49 |
base_pipe.unet = compiledModel
|
50 |
|
|
|
51 |
generated_image = base_pipe(
|
52 |
-
|
53 |
num_inference_steps=5,
|
54 |
).images[0]
|
55 |
|
|
|
7 |
DDPMScheduler,
|
8 |
StableDiffusionXLImg2ImgPipeline,
|
9 |
AutoencoderKL,
|
10 |
+
load_image,
|
11 |
)
|
12 |
|
13 |
os.system("pip install torch_tensorrt==2.4.0")
|
|
|
49 |
|
50 |
base_pipe.unet = compiledModel
|
51 |
|
52 |
+
init_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/img2img.png")
|
53 |
generated_image = base_pipe(
|
54 |
+
init_image,
|
55 |
num_inference_steps=5,
|
56 |
).images[0]
|
57 |
|