简介

SDXL1.0模型是Stability AI 推出的一款免费图像生成模型,输出的图像分辨率提高到了1024×1024,简化了步骤,让文生图变得更为便捷高效,几句话就可以输出美观的图像。
项目地址:https://github.com/Stability-AI/generative-models
模型下载:
base model :https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0
refiner model:https://huggingface.co/stabilityai/stable-diffusion-xl-refiner-1.0
ComfyUI:https://github.com/comfyanonymous/ComfyUI
Windows Version:https://github.com/comfyanonymous/ComfyUI/releases/download/latest/ComfyUI_windows_portable_nvidia_cu121_or_cpu.7z
在线体验:https://stability.ai
模型大小:6~7GB
推荐配置:6GB或以上显存的NVIDIA显卡,1GB/s或以上的硬盘读写速度。

用法

首先下载ConfyUI(windows用户直接下载整合包)和模型,解压后把模型放入主目录中的ComfyUI➡models➡checkpoints 文件夹中,例如:G:\Project\Stable Diffusion1.0\ComfyUI_windows_portable\ComfyUI\models\checkpoints
英伟达显卡运行run_nvidia_gpu.bat,没有可以运行run_cpu.bat(显存不足自动开启低显存模式),稍等片刻自动打开网页程序
cmd界面,GPU低显存模式
图形界面
可以看到图形界面有正面提示词和负面提示词,可以运行默认的提示词先看看效果,点击Queue Prompt生成,第一次出图一般都是下面这张:
彩色玻璃瓶
注意第一次使用要先加载模型,加载速度和硬盘读写速度以及设备性能有关。如果配置较低请耐心等待,并没有卡住,只是比较慢罢了。
在Empty Latent Image 下可以修改生成的图像大小,最大像素为1024×1024,默认512×512
在Ksample下可以修改步数和CFG值(classifier-free guidance scale),并不是越高越好,可自行摸索。
图像生成后自动保存到ComfyUI下的output文件夹中,也可以右键图像,自定义存储位置。
想要生成复杂的图形一定要多加一些提示词
,可以自行谷歌相关模板。

视频教程

只需两步,本地使用stable diffusion模型SDXL1.0|AI探索与发现
视频的后半段为stable-diffusion-webui的安装教程,配置要求更高,显存≥12GB推荐试一试,可以安装额外的插件,更为方便。

提示词

能否生成好的图像很大程度上取决于提示词的用法,下面是一些样本可供参考
来源:SDXL 1.0 多种风格高质量prompt

Generic Starter Prompt通用提示词
Prompt :breathtaking {prompt} . award-winning, professional, highly detailed
Negative :anime, cartoon, graphic, text, painting, crayon, graphite, abstract glitch, blurry
示例:
Prompt :breathtaking selfie photograph of astronaut floating in space, earth in the background. award-winning, professional, highly detailed
Negative :anime, cartoon, graphic, text, painting, crayon, graphite, abstract glitch, blurry

Anime动画风格:
Prompt :anime artwork {prompt} . anime style, key visual, vibrant, studio anime, highly detailed
Negative :photo, deformed, black and white, realism, disfigured, low contrast
示例:
Prompt :anime artwork an empty classroom. anime style, key visual, vibrant, studio anime, highly detailed
Negative :photo, deformed, black and white, realism, disfigured, low contrast

Digital Art / Concept Art 数字艺术/概念艺术:
Prompt :concept art {prompt}. digital artwork, illustrative, painterly, matte painting, highly detailed
Negative :photo, photorealistic, realism, ugly
示例:
Prompt :concept art of a warrior with a sword, clouds. digital artwork, illustrative, painterly, matte painting, highly detailed, cinematic composition
Negative :photo, photorealistic, realism, ugly

Fantasy Art 幻想艺术:
Prompt :ethereal fantasy concept art of {prompt} . magnificent, celestial, ethereal, painterly, epic, majestic, magical, fantasy art, cover art, dreamy
Negative :photographic, realistic, realism, 35mm film, dslr, cropped, frame, text, deformed, glitch, noise, noisy, off-center, deformed, cross-eyed, closed eyes, bad anatomy, ugly, disfigured, sloppy, duplicate, mutated, black and white
示例:
Prompt :ethereal fantasy concept art of sorceress casting spells. magnificent, celestial, ethereal, painterly, epic, majestic, magical, fantasy art, cover art, dreamy
Negative :photographic, realistic, realism, 35mm film, dslr, cropped, frame, text, deformed, glitch, noise, noisy, off-center, deformed, cross-eyed, closed eyes, bad anatomy, ugly, disfigured, sloppy, duplicate, mutated, black and white

Photography 图片风格:
Prompt :Photographic of {prompt}. 35mm photograph, film, bokeh, professional, 4k, highly detailed
Negative :drawing, painting, crayon, sketch, graphite, impressionist, noisy, blurry, soft, deformed, ugly
示例:
Prompt :Photographic of a construction worker looking down at city. 35mm photograph, film, bokeh, professional, 4k, highly detailed
Negative :drawing, painting, crayon, sketch, graphite, impressionist, noisy, blurry, soft, deformed, ugly

Cinematic 电影风格:
Prompt :cinematic film still {prompt} . shallow depth of field, vignette, highly detailed, high budget Hollywood movie, bokeh, cinemascope, moody
Negative :anime, cartoon, graphic, text, painting, crayon, graphite, abstract, glitch, deformed, mutated, ugly, disfigured
示例:
Prompt :cinematic film still, iron man. shallow depth of field, vignette, highly detailed, high budget Hollywood movie, bokeh, cinemascope, moody, epic, gorgeous, film grain, grainy
Negative :anime, cartoon, graphic, text, painting, crayon, graphite, abstract, glitch, deformed, mutated, ugly, disfigured

Analog film 胶片电影滤镜风格:
Prompt :analog film photo {prompt} . faded film, desaturated, 35mm photo, grainy, vignette, vintage, Kodachrome, Lomography, stained, highly detailed, found footage
Negative :painting, drawing, illustration, glitch, deformed, mutated, cross-eyed, ugly, disfigured
示例:
Prompt :analog film photo of old woman on the streets of london . faded film, desaturated, 35mm photo, grainy, vignette, vintage, Kodachrome, Lomography, stained, highly detailed, found footage
Negative :painting, drawing, illustration, glitch, deformed, mutated, cross-eyed, ugly, disfigured

Neon Punk 明亮朋克风格:
Prompt :neon Punk {prompt} . vibes, stunningly beautiful, crisp, detailed, sleek, ultramodern, high contrast, cinematic composition
Negative :Blurry lines, Jagged lines, faded colors, faded images
示例:
Prompt :NPai, 1990s sports car drifting through a jungle, hyperdetailed, maximalism, RAW photo, perfect aesthetic, grainy film, Fujifilm, textured skin, highly detailed and intricate
Negative :Blurry lines, Jagged lines, faded colors, faded images

Craft Clay 黏土风格:
Prompt :claymation style {prompt} . sculpture, clay art, centered composition, play-doh
Negative :sloppy, messy, grainy, highly detailed, ultra textured, photo, mutated
示例:
Prompt :claymation style captain jack sparrow on tropical island. sculpture, clay art, centered composition, play-doh
Negative :sloppy, messy, grainy, highly detailed, ultra textured, photo, mutated

3D Model 3D模型:
Prompt :professional 3d model {prompt} . octane render, highly detailed, volumetric, dramatic lighting
Negative :ugly, deformed, noisy, low poly, blurry, painting
示例:
Prompt :professional 3d model bulky purple mecha with missiles. octane render, highly detailed, volumetric, dramatic lighting
Negative :ugly, deformed, noisy, low poly, blurry, painting

Origami 折纸艺术:
Prompt :origami style {prompt} . paper art, pleated paper, folded, origami art, pleats, cut and fold, centered composition
Negative :noisy, sloppy, messy, grainy, highly detailed, ultra textured, photo
示例:
Prompt :origami style Winterfell. paper art, pleated paper, folded, origami art, pleats, cut and fold, centered composition
Negative :noisy, sloppy, messy, grainy, highly detailed, ultra textured, photo

Line Art 线稿艺术:
Prompt :line art drawing {prompt} . professional, sleek, modern, minimalist, graphic, line art, vector graphics
Negative :anime, photorealistic, 35mm film, deformed, glitch, blurry, noisy, off-center, deformed, cross-eyed, closed eyes, bad anatomy, ugly, disfigured, mutated, realism, realistic, impressionism, expressionism, oil, acrylic
示例:
Prompt :line art of a kitchen in perspective. professional, sleek, modern, minimalist, graphic, line art, vector graphics
Negative :anime, photorealistic, 35mm film, deformed, glitch, blurry, noisy, off-center, deformed, cross-eyed, closed eyes, bad anatomy, ugly, disfigured, mutated, realism, realistic, impressionism, expressionism, oil, acrylic

Pixel Art 像素艺术:
Prompt :pixel-art {prompt} . low-res, blocky, pixel art style, 16-bit graphics
Negative :sloppy, messy, blurry, noisy, highly detailed, ultra textured, photo, realistic
示例:
Prompt :16-bit pixel art, a cozy cafe side view, a beautiful day
Negative :sloppy, messy, blurry, noisy, highly detailed, ultra textured, photo, realistic

Isometric Style 等距风格:
Prompt :isometric style of {prompt}.low-res, blocky
Negative :noisy, ultra textured, photo, realistic
示例:
Prompt :isometric style of wizard working on spells. low-res, blocky
Negative :noisy, ultra textured, photo, realistic

Comic Book 漫画风格:
Prompt :comic book style {prompt}.professional detailed graphic novel illustration, intricate linework, intricate strokes
Negative :anime face, ugly, old, anime style, cartoonish, anime face, photoreal, nude, (poorly drawn face, cross-eyed), sweaty skin, latex clothes, low fidelity
示例:
Prompt :comic book style,Handsome man wearing a bulky fur coat, detailed hair, sitting in a well lit warm log wood cabin indoors, winter time, cozy scene, detailed reflective eyes, holding a book and lantern, warm lighting, (stormy snow window in the background), luxurious lodge, professional detailed graphic novel illustration, intricate linework, intricate strokes
Negative :anime face, ugly, old, anime style, cartoonish, anime face, photoreal, nude, (poorly drawn face, cross-eyed), sweaty skin, latex clothes, low fidelity

Texture 材质风格:
Prompt :texture {prompt} top down close-up, video game
Negative :ugly, deformed, noisy, blurry, anime, photorealistic, 35mm film, glitch, off-center, deformed, impressionism, expressionism, oil, acrylic
示例:
Prompt :texture of marble, top down close-up, video game
Negative :ugly, deformed, noisy, blurry, anime, photorealistic, 35mm film, glitch, off-center, deformed, impressionism, expressionism, oil, acrylic