最新消息: USBMI致力于为网友们分享Windows、安卓、IOS等主流手机系统相关的资讯以及评测、同时提供相关教程、应用、软件下载等服务。

Diffuser: Potential NSFW content was detected in one or more images.

业界 admin 2浏览 0评论

使用controlnet的过程中碰到以下问题,直接得到黑色图像

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.

搜索GitHub高赞解决方案:

pipe.safety_checker = lambda images, clip_input: (images, False)

然而,报错:

  File "xxxxx\diffusers\src\diffusers\pipelines\controlnet\pipeline_controlnet.py", line 1327, in __call__
    do_denormalize = [not has_nsfw for has_nsfw in has_nsfw_concept]
TypeError: 'bool' object is not iterable

 去pipeline_controlnet.py里看代码:

 因此,应该改为:

pipe.safety_checker = lambda images, clip_input: (images, None)

解决问题了 

使用controlnet的过程中碰到以下问题,直接得到黑色图像

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.

搜索GitHub高赞解决方案:

pipe.safety_checker = lambda images, clip_input: (images, False)

然而,报错:

  File "xxxxx\diffusers\src\diffusers\pipelines\controlnet\pipeline_controlnet.py", line 1327, in __call__
    do_denormalize = [not has_nsfw for has_nsfw in has_nsfw_concept]
TypeError: 'bool' object is not iterable

 去pipeline_controlnet.py里看代码:

 因此,应该改为:

pipe.safety_checker = lambda images, clip_input: (images, None)

解决问题了 

与本文相关的文章

发布评论

评论列表 (0)

  1. 暂无评论