Skip to content

Commit 0bda1d7

Browse files
asfiyab-nvidiatolgacangozDN6
authored
Update TensorRT img2img community pipeline (#8899)
* Update TensorRT img2img pipeline Signed-off-by: Asfiya Baig <[email protected]> * Update TensorRT version installed Signed-off-by: Asfiya Baig <[email protected]> * make style and quality Signed-off-by: Asfiya Baig <[email protected]> * Update examples/community/stable_diffusion_tensorrt_img2img.py Co-authored-by: Tolga Cangöz <[email protected]> * Update examples/community/README.md Co-authored-by: Tolga Cangöz <[email protected]> * Apply style and quality using ruff 0.1.5 Signed-off-by: Asfiya Baig <[email protected]> --------- Signed-off-by: Asfiya Baig <[email protected]> Co-authored-by: Tolga Cangöz <[email protected]> Co-authored-by: Dhruv Nair <[email protected]>
1 parent 527430d commit 0bda1d7

File tree

2 files changed

+145
-76
lines changed

2 files changed

+145
-76
lines changed

examples/community/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1641,18 +1641,18 @@ from io import BytesIO
16411641
from PIL import Image
16421642
import torch
16431643
from diffusers import DDIMScheduler
1644-
from diffusers.pipelines.stable_diffusion import StableDiffusionImg2ImgPipeline
1644+
from diffusers import DiffusionPipeline
16451645

16461646
# Use the DDIMScheduler scheduler here instead
16471647
scheduler = DDIMScheduler.from_pretrained("stabilityai/stable-diffusion-2-1",
16481648
subfolder="scheduler")
16491649

16501650

1651-
pipe = StableDiffusionImg2ImgPipeline.from_pretrained("stabilityai/stable-diffusion-2-1",
1652-
custom_pipeline="stable_diffusion_tensorrt_img2img",
1653-
variant='fp16',
1654-
torch_dtype=torch.float16,
1655-
scheduler=scheduler,)
1651+
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-2-1",
1652+
custom_pipeline="stable_diffusion_tensorrt_img2img",
1653+
variant='fp16',
1654+
torch_dtype=torch.float16,
1655+
scheduler=scheduler,)
16561656

16571657
# re-use cached folder to save ONNX models and TensorRT Engines
16581658
pipe.set_cached_folder("stabilityai/stable-diffusion-2-1", variant='fp16',)

0 commit comments

Comments
 (0)