Skip to content

这里的Prompt处理方式和AIGC网页的处理方式似乎不一样? #1026

@sakura-0v0

Description

@sakura-0v0

使用相同模型,相同参数的情况下,输出的图片效果差得太多。
即使使用的提示词比较长,modelscope的AIGC生成的效果也不错的,但是在我的代码中保持了相同的参数情况下,生成的图片相关性差太多了。
例如,这个例子中,正反提示词相同,分辨率相同,提示词引导系数相同,采样步数
相同,AIGC开启生成4张图片--
AIGC网页端:生成了4张图片,这四张图片的任意一张,都几乎满足了全部条件,生成了一个鸭子坐在床上的心海,虽然其中一张jk并不是粉色的。

Image

我的代码:即使排在较前面的full-body portrait也没有满足,生成的是一个上至腹部下至大腿根部的高度放大的一个视角,按道理来说full-body portrait排在前面,权重不小的,期望会生成一个包含全身的图片。

Image

为什么会出现这种现象?是AIGC网页端对提示词进行了其他的处理吗,还是说我少了什么关键步骤吗?

import os
import torch
print(torch.version.cuda)
from diffsynth import ModelManager, SDXLImagePipeline, download_models
import torch


type=Model&format=SafeTensor&size=pruned&fp=fp16)

base_path = r'C:\Users\Administrator\.cache\modelscope\hub\models\yuyuuyu\anishadow2'
# Load models
model_manager = ModelManager(torch_dtype=torch.float16, device="cuda")
model_manager.load_models([os.path.join(base_path, "AniShadow_V2.safetensors")])
pipe: SDXLImagePipeline = SDXLImagePipeline.from_model_manager(model_manager)

prompt = "Genshin Impact Kokomi,pink JK skirt,pink JK uniform, a cute beautiful girl,full-body portrait, 2D flat art style, exquisite artistic style, rich in details, masterpiece, best quality,adorable face,frown,climax,blush,really enjoy, exquisite facial features, short top,expose the navel,White thigh-high socks,  cute bed, cozy bedroom,fluffy pillows, pink comforte, in a cute seiza pose, legs slightly splayed with a small gap between them,"
negative_prompt = "realistic, photo, low quality, Abnormal fingers,abnormality,simple background, solid color background, emoji, bare chest,bare genitals,bad anatomy, bad hands,black skirt, black top,closed mouth, ugly"



w = 480
h = 696

w_2 = w - (w % 8)
h_2 = h - (h % 8)

torch.manual_seed(0)
image = pipe(
    prompt=prompt,
    negative_prompt=negative_prompt,
    # scheduler="DPM++ 3M SDE Karras",
    # num_images_per_prompt=2,
    num_inference_steps=30,
    height=int(h_2),
    width=int(w_2),
    cfg_scale=7.5,
)

image.save("result_1.png")


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions