You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SDv1.5 generate black image with torch_tensorrt compile
log on cmd:
Lib\site-packages\diffusers\image_processor.py:97: RuntimeWarning: invalid value encountered in cast
images = (images * 255).round().astype("uint8")
Potential NSFW content was detected in one or more images. A black image will be returned instead. Try again with a different prompt and/or seed.
To Reproduce
Follow the official example:
`import torch
import torch_tensorrt
from diffusers import DiffusionPipeline
model_id = "stable-diffusion-v1-5"
device = "cuda:0"
pipe = DiffusionPipeline.from_pretrained(
model_id, revision="fp16", torch_dtype=torch.float16
)
pipe = pipe.to(device)
Seems like this is coming from diffusers: Potential NSFW content was detected in one or more images. A black image will be returned instead. Try again with a different prompt and/or seed. Dont think this involves Torch-TRT
Seems like this is coming from diffusers: Potential NSFW content was detected in one or more images. A black image will be returned instead. Try again with a different prompt and/or seed. Dont think this involves Torch-TRT
Hi,
The strange thing is that when I remove the torch_tensorrt compiled code, using the same prompt and seed, it could generate the correct image.
The GPU i used is RTX4060 Laptop (8GB)
Driver Version: 560.70 CUDA Version: 12.6
Bug Description
SDv1.5 generate black image with torch_tensorrt compile
log on cmd:
Lib\site-packages\diffusers\image_processor.py:97: RuntimeWarning: invalid value encountered in cast
images = (images * 255).round().astype("uint8")
Potential NSFW content was detected in one or more images. A black image will be returned instead. Try again with a different prompt and/or seed.
To Reproduce
Follow the official example:
`import torch
import torch_tensorrt
from diffusers import DiffusionPipeline
model_id = "stable-diffusion-v1-5"
device = "cuda:0"
pipe = DiffusionPipeline.from_pretrained(
model_id, revision="fp16", torch_dtype=torch.float16
)
pipe = pipe.to(device)
backend = "torch_tensorrt"
pipe.unet = torch.compile(
pipe.unet,
backend=backend,
options={
"truncate_long_and_double": True,
"enabled_precisions": {torch.float32, torch.float16},
},
dynamic=False,
)`
Expected behavior
SDv1.5 generate a normal image
Environment
tensorrt 10.1.0
tensorrt-cu12 10.2.0.post1
tensorrt-cu12_bindings 10.1.0
tensorrt-cu12_libs 10.1.0
torch 2.4.0+cu124
torch_tensorrt 2.4.0
torchaudio 2.4.0+cu124
torchvision 0.19.0+cu124
Additional context
The text was updated successfully, but these errors were encountered: