Skip to content

血的教训:关键词排除 #10

@Loping151

Description

@Loping151

先放个方案在这

在100行左右开始改为

                if re.search(r'nsfw', prompt, re.IGNORECASE):
                    reply = Reply(ReplyType.TEXT, "你想封我号吗,朋友")
                else:
                    if len(options) > 0:
                        logger.info("[SD] cover options={}".format(options))
                        self.api.set_options(options)
                    logger.info("[SD] params={}".format(params))
                    result = self.api.txt2img(
                        **params
                    )
                    reply.type = ReplyType.IMAGE
                    b_img = io.BytesIO()
                    result.image.save(b_img, format="PNG")
                    reply.content = b_img

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions