AI 绘画快速开始-StableDiffusionWebui

2023-12-13 09:44

本文主要是介绍AI 绘画快速开始-StableDiffusionWebui,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

文章目录

    • 介绍
    • WebUI 的安装和部署
    • 参数介绍
    • Prompt技巧
      • 初阶Prompt:直接描述的精细化
      • 二阶Prompt:巧用标签的扩展
      • 三阶Prompt:负面提示词的深入应用
      • 四阶Prompt:文本权重调整的细化
      • 引入 LoRA:模型特效的创新应用
    • 案例-生成漫画 (LoRA)
      • 分镜1: 出发
      • 分镜2: 火车站
      • 分镜3: 古城探险
      • 分镜4: 山川间
      • 分镜5: 海边日落
      • 分镜6: 夜市灯光

介绍

Stable Diffusion web UI是一个基于Gradio库的Stable Diffusion图像生成的网页接口。

Stable Diffusion是一个使用深度学习对文本进行图像生成的系统。它由Anthropic公司开发,基于 transformer 得到快速发展。

这个网页界面利用 Gradio 库,将 Stable Diffusion 应用到一个可视化的网页应用中。用户可以通过简单的提示文本生成高质量的图像。

该项目的主要功能和特性包括:

  • 原始的文字到图像和图像到图像生成模式
  • 一键安装和运行脚本,方便用户快速上手
  • 支持扩充生成、修复补全等功能
  • 丰富的调节生成参数的界面
  • 支持多个后处理模型提升生成图片质量
  • 训练自定义嵌入向量等功能
  • 社区提供的各种扩展脚本
  • 优化的推理速度,可以在低显存环境运行
    该项目由 Github 用户 AUTOMATIC1111 创建和维护,采用 AGPL-3.0 开源协议。它极大地方便了Stable Diffusion在本地机器上的部署使用,提供了丰富的功能,是基于该模型的图像生成的首选工具之一。一个活跃的社区为其不断新增功能和维护。

WebUI 的安装和部署

参考https://github.com/AUTOMATIC1111/stable-diffusion-webui.git 安装部署

参数介绍

  • Prompt - 文本提示,用于描述目标生成图像的内容、样式等信息。
  • Negative Prompt - 排除的文本,用于指出不希望在生成图像中出现的内容。
  • Steps - 图像生成的迭代步数,步数越多图像质量越高。
  • Sampling Method - 采样方法,不同方法会影响图像质量和样式。
  • Seed - 随机种子数,用于控制生成结果的多样性。
  • Size - 生成图片的分辨率大小。
  • Model - 选择使用的Stable Diffusion模型变量。
  • Strength - 指导生成图片符合提示的强度。
  • Scale - 控制生成图片样式的缩放程度。
  • CFG Scale - 控制文本编码器输出的缩放比例。
  • Batch Size - 同时生成的图片数量。
  • Batch Count - 生成的批次数量。
  • 文本到图像(txt2img) - 这是最基础的功能,可以直接在Prompt框中输入文本描述,生成对应图像。支持控制风格、内容等。
  • 图像到图像(img2img) - 可以输入一张图像,经过模型处理生成修订版本。支持补全、扩充、调整样式等。
  • Outpainting - 基于一张图像,扩充图像边界区域,生成更大尺寸的图片。
  • Inpainting - 修复图像中遮挡或损坏的区域,使图片完整。
  • Color Sketch - 输入素描画,生成对应颜色图片。
  • Stable Diffusion Upscale - 使用模型进行图片超分辨率处理。
  • Attention - 通过特殊语法强调文本中的重点内容,模型会聚焦在这些部分。
  • Prompt Matrix - 通过矩阵排列不同prompt,自动生成图片网格。
  • 循环生成(Loopback) - 将图片循环多次输入模型,实现图像迭代优化。
  • 故障检测(CLIP Interrogator) - 分析图像判断最可能的生成提示。
  • 无缝处理(Seamless) - 自动处理生成图片边界,实现无缝拼接。

Prompt技巧

初阶Prompt:直接描述的精细化

  • 在描述时,尽量具体化。例如,不仅是 “a happy dog and a cute girl”,而是 “a joyful golden retriever playing with a smiling girl in a sunny park”。这样的详细描述能帮助模型更准确地捕捉您的创作意图。

二阶Prompt:巧用标签的扩展

  • 现在让我们进一步提升这幅画的质量,方法就是使用标签(tag)继续优化。best quality, masterpiece, a happy dog and a cute girl, watercolor style。 除了 “best quality” 和 “masterpiece”,可以加入更具体的艺术风格或细节描述,如 “vibrant colors, intricate details”。例如,“vibrant colors, intricate details, best quality, masterpiece, a happy dog and a cute girl, watercolor style”。
  • 延伸内容:探索不同艺术流派的标签,如 “impressionist, surrealism, or baroque style”,以及特定艺术家的风格,如 “in the style of Van Gogh or Picasso”。

三阶Prompt:负面提示词的深入应用

  • 在使用负向提示词时,可以更具体地指出不希望出现的元素,如 “no crowds, avoid oversaturation, no photorealism”。
  • 延伸内容:利用负面提示词来排除常见的AI生成错误,如 “no floating objects, no mismatched perspectives”。

四阶Prompt:文本权重调整的细化

  • 使用括号来强调特定元素时,可以结合形容词增强效果,如 “a happy (big dog) and a (tiny cute girl), watercolor style”。
  • 延伸内容:尝试对比不同权重下的效果,如 “(dog:1.5) and (girl:0.5)”,来控制图像中元素的相对重要性。

引入 LoRA:模型特效的创新应用

  • 在使用 LoRA 时,确保模型文件名和权重适当匹配您的创作目标,如 “lora:artistic_model:1.2”。
  • 延伸内容:实验不同的 LoRA 模型来探索各种视觉效果,如 “lora:cinematic_effect:1.0” 或 “lora:dreamy_landscape:1.5”,以创造独特的艺术作品。

案例-生成漫画 (LoRA)

LoRA(Long Range Arena)是一种用于图像生成的新方法,其基本原理如下:

  • LoRA 使用了与Stable Diffusion类似的Diffusion模型结构,包括Encoder,Decoder,UNet等组件。
  • LoRA 提出了一种新的自回归(Auto-regressive)策略,可以capture更长范围的依赖关系。
  • 在训练阶段,LoRA 通过预测序列中远距离的token来进行训练,而不是只预测相邻的token。
  • 在推理阶段,LoRA 通过采样不同步长的序列,合并为完整的序列,从而实现了更长范围的依赖建模。
  • LoRA还设计了一种类似Transformer的跨层Attention机制,不同层之间可以建立依赖关系。
    通过上述特点,LoRA可以model更丰富的长程依赖,生成更连贯、合理的图像。

用的Base Model https://civitai.com/models/9409?modelVersionId=30163

用LoRA https://civitai.com/models/88201?modelVersionId=93864

在构建一个漫画分镜故事,可以采取一种简单的叙述流程,以讲述一个小女孩旅行的故事。以下是一种可能的分镜顺序:

分镜1: 出发

  • 画面: 小女孩背着一个大背包站在家门口。她的猫咪在她的脚边,仰头望着她。
  • 文字: “小丽准备好了她的冒险,家门口的告别总是有些苦涩。”
  • prompt
A little girl stands at the doorway of her home, ready for an adventure. She has a large backpack that is almost as big as her tiny frame. By her feet sits her fluffy orange cat, gazing up at her with curious eyes. Gentle light catches on the girl's windblown hair and shining eyes, full of excitement and optimism. Her cat's fur ripples in the breeze. Lush greenery and colorful flowers surround the simple home's exterior. A path leads from the door into a sunny day filled with possibilities. Digital painting, peaceful atmosphere, childhood wonder, bond between girl and pet, smooth skin, lifelike fur, vivid yet calming colors, finely rendered details, illustrative style <lora:Iku_Nakatani:1>
  • negative prompt
EasyNegative, (worst quality, low quality:1.4), (lip, nose, rouge, lipstick:1.4), (jpeg artifacts:1.4), (1boy, abs, muscular:1.0), greyscale, monochrome, dusty sunbeams, trembling, motion lines, motion blur, emphasis lines, text, title, logo, signature

分镜2: 火车站

  • 画面: 小女孩坐在火车站的长椅上,一边看着手中的火车票,一边期待地望向铁轨。
  • 文字: “火车站人来人往,小丽的心中充满了即将启程的激动。”
  • prompt
A young girl sits pensively on a wooden bench at a small train station, the late afternoon light casting a warm glow over her features. In her small hands she clutches an tickets, tracing over the letters and numbers with her fingertips as she gazes expectantly down the railroad tracks. Ripples in the ties lead the eye into the distant point where sky meets earth. A gentle breeze tousles the girl's hair as birdsong and the rumble of a distant locomotive are carried on the wind. A sense of anticipation and excitement mingles with the stillness of waiting as the moments tick by. Digital painting, atmospheric perspective, nostalgic mood, attention to tiny details, emotionally evocative light and colors, smooth skin, textured surfaces, inviting the viewer to share in the girl's wondering thoughts <lora:Iku_Nakatani:1>
  • negative prompt
EasyNegative, (worst quality, low quality:1.4), (lip, nose, rouge, lipstick:1.4), (jpeg artifacts:1.4), (1boy, abs, muscular:1.0), greyscale, monochrome, dusty sunbeams, trembling, motion lines, motion blur, emphasis lines, text, title, logo, signature 

分镜3: 古城探险

  • 画面: 小女孩站在一座古老城堡的巨大城门前,眼睛充满好奇。
  • 文字: “古城的神秘召唤着小丽,每块石头都诉说着历史的故事。”
  • prompt
A young girl gazes up at immense castle gates that block her view inside. Moss clings to weathered stones taller than any building she's seen. Two wooden doors stand closed yet unbarred. Sunlight catches motes of dust as ravens call from high above. Curiosity swells within her at the mysteries the old walls hide. What wonders and legends wait within those towering walls for an adventurous visitor to discover? <lora:Iku_Nakatani:1>
  • negative prompt
EasyNegative, (worst quality, low quality:1.4), (lip, nose, rouge, lipstick:1.4), (jpeg artifacts:1.4), (1boy, abs, muscular:1.0), greyscale, monochrome, dusty sunbeams, trembling, motion lines, motion blur, emphasis lines, text, title, logo, signature 

分镜4: 山川间

  • 画面: 小女孩在翠绿的山谷中跳跃,手臂张开,仿佛整个世界都在欢迎她。
  • 文字: “绿意盎然的山谷中,小丽感受自然的力量和美丽。”
  • prompt
A young girl spins and twirls amidst a lush green valley, arms outstretched as if to embrace the vibrant natural surrounds. Golden sunlight dances over her smiling face and through the leaves, illuminating her carefree glee. Grasses and wildflowers sway to the rhythm of her dancing feet, partners in her play.Butterflies flit amid the shimmering foliage as dancing shadows cast dancing girls upon the hills. Laughter floats upon the breeze like birdsong through towering trees. No sound but for the gurgling brook can match the girl's tuneless melody of mirth.Here, surrounded by the valley's verdant embrace, she is queen of her own private realm, filled with the wonders and joy of youth. Golden light gilds petals, pollen, and peasant's hair alike, a living child amidst a living tapestry of delight. <lora:Iku_Nakatani:1>
  • negative prompt
EasyNegative, (worst quality, low quality:1.4), (lip, nose, rouge, lipstick:1.4), (jpeg artifacts:1.4), (1boy, abs, muscular:1.0), greyscale, monochrome, dusty sunbeams, trembling, motion lines, motion blur, emphasis lines, text, title, logo, signature 

分镜5: 海边日落

  • 画面: 小女孩坐在沙滩上,眼睛注视着海平线上的落日。
  • 文字: “金色的夕阳与海的边界相遇,小丽被这壮丽的景色深深吸引。”
  • prompt
Young girl sitting on the beach, gazing at the sunset on the horizon, warm orange and pink hues reflecting off her skin and clothing, sandy feet buried in the shore, windswept hair gently blowing in the breeze, delicate features peacefully illuminated in the dying light, intricate details in the folds of her sundress and textures of the sand, elegant composition, smooth colors blended seamlessly, highly realistic digital painting style, art by Greg Rutkowski and Alphonse Mucha <lora:Iku_Nakatani:1>
  • negative prompt
EasyNegative, (worst quality, low quality:1.4), (lip, nose, tooth, rouge, lipstick, eyeshadow:1.4), (jpeg artifacts:1.4), (bokeh, blurry, film grain, chromatic aberration, lens flare:1.0), (1boy, abs, muscular, rib:1.0), greyscale, monochrome, dusty sunbeams, trembling, motion lines, motion blur, emphasis lines, text, title, logo, signature, simple background, white background

分镜6: 夜市灯光

  • 画面: 小女孩走在热闹的夜市中,周围是各种摊位和闪烁的灯笼。
  • 文字: “五彩斑斓的灯光下,小丽在夜市中尝试着各种美食,每一口都是新鲜的体验。”
  • prompt
Young girl wandering through a bustling night market, vibrant stalls and flashing paper lanterns lining the alleyway on both sides, colorful lights dancing off her excited face as she takes in the lively atmosphere, delicate features and flowing sundress elegantly illuminated amidst the hustle and bustle, intricate woven details in the tapestries and fabrics fluttering overhead, smooth blending of warm tones capturing the joyful energy, highly realistic digital painting style, art by Greg Rutkowski and Alphonse Mucha <lora:Iku_Nakatani:1>
  • negative prompt
EasyNegative, (worst quality, low quality:1.4), (lip, nose, tooth, rouge, lipstick, eyeshadow:1.4), (jpeg artifacts:1.4), (bokeh, blurry, film grain, chromatic aberration, lens flare:1.0), (1boy, abs, muscular, rib:1.0), greyscale, monochrome, dusty sunbeams, trembling, motion lines, motion blur, emphasis lines, text, title, logo, signature, simple background, white background

每个分镜都突出了旅行的一个特定阶段,从准备出发到探索新地方,再到旅途的回忆。这种结构能够帮助读者跟随小女孩的旅行经历,感受她的情感起伏。

在这里插入图片描述

这篇关于AI 绘画快速开始-StableDiffusionWebui的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/487983

相关文章

Ilya-AI分享的他在OpenAI学习到的15个提示工程技巧

Ilya(不是本人,claude AI)在社交媒体上分享了他在OpenAI学习到的15个Prompt撰写技巧。 以下是详细的内容: 提示精确化:在编写提示时,力求表达清晰准确。清楚地阐述任务需求和概念定义至关重要。例:不用"分析文本",而用"判断这段话的情感倾向:积极、消极还是中性"。 快速迭代:善于快速连续调整提示。熟练的提示工程师能够灵活地进行多轮优化。例:从"总结文章"到"用

AI绘图怎么变现?想做点副业的小白必看!

在科技飞速发展的今天,AI绘图作为一种新兴技术,不仅改变了艺术创作的方式,也为创作者提供了多种变现途径。本文将详细探讨几种常见的AI绘图变现方式,帮助创作者更好地利用这一技术实现经济收益。 更多实操教程和AI绘画工具,可以扫描下方,免费获取 定制服务:个性化的创意商机 个性化定制 AI绘图技术能够根据用户需求生成个性化的头像、壁纸、插画等作品。例如,姓氏头像在电商平台上非常受欢迎,

从去中心化到智能化:Web3如何与AI共同塑造数字生态

在数字时代的演进中,Web3和人工智能(AI)正成为塑造未来互联网的两大核心力量。Web3的去中心化理念与AI的智能化技术,正相互交织,共同推动数字生态的变革。本文将探讨Web3与AI的融合如何改变数字世界,并展望这一新兴组合如何重塑我们的在线体验。 Web3的去中心化愿景 Web3代表了互联网的第三代发展,它基于去中心化的区块链技术,旨在创建一个开放、透明且用户主导的数字生态。不同于传统

AI一键生成 PPT

AI一键生成 PPT 操作步骤 作为一名打工人,是不是经常需要制作各种PPT来分享我的生活和想法。但是,你们知道,有时候灵感来了,时间却不够用了!😩直到我发现了Kimi AI——一个能够自动生成PPT的神奇助手!🌟 什么是Kimi? 一款月之暗面科技有限公司开发的AI办公工具,帮助用户快速生成高质量的演示文稿。 无论你是职场人士、学生还是教师,Kimi都能够为你的办公文

Andrej Karpathy最新采访:认知核心模型10亿参数就够了,AI会打破教育不公的僵局

夕小瑶科技说 原创  作者 | 海野 AI圈子的红人,AI大神Andrej Karpathy,曾是OpenAI联合创始人之一,特斯拉AI总监。上一次的动态是官宣创办一家名为 Eureka Labs 的人工智能+教育公司 ,宣布将长期致力于AI原生教育。 近日,Andrej Karpathy接受了No Priors(投资博客)的采访,与硅谷知名投资人 Sara Guo 和 Elad G

电脑桌面文件删除了怎么找回来?别急,快速恢复攻略在此

在日常使用电脑的过程中,我们经常会遇到这样的情况:一不小心,桌面上的某个重要文件被删除了。这时,大多数人可能会感到惊慌失措,不知所措。 其实,不必过于担心,因为有很多方法可以帮助我们找回被删除的桌面文件。下面,就让我们一起来了解一下这些恢复桌面文件的方法吧。 一、使用撤销操作 如果我们刚刚删除了桌面上的文件,并且还没有进行其他操作,那么可以尝试使用撤销操作来恢复文件。在键盘上同时按下“C

AI hospital 论文Idea

一、Benchmarking Large Language Models on Communicative Medical Coaching: A Dataset and a Novel System论文地址含代码 大多数现有模型和工具主要迎合以患者为中心的服务。这项工作深入探讨了LLMs在提高医疗专业人员的沟通能力。目标是构建一个模拟实践环境,人类医生(即医学学习者)可以在其中与患者代理进行医学

AI行业应用(不定期更新)

ChatPDF 可以让你上传一个 PDF 文件,然后针对这个 PDF 进行小结和提问。你可以把各种各样你要研究的分析报告交给它,快速获取到想要知道的信息。https://www.chatpdf.com/

【北交大信息所AI-Max2】使用方法

BJTU信息所集群AI_MAX2使用方法 使用的前提是预约到相应的算力卡,拥有登录权限的账号密码,一般为导师组共用一个。 有浏览器、ssh工具就可以。 1.新建集群Terminal 浏览器登陆10.126.62.75 (如果是1集群把75改成66) 交互式开发 执行器选Terminal 密码随便设一个(需记住) 工作空间:私有数据、全部文件 加速器选GeForce_RTX_2080_Ti

AI Toolkit + H100 GPU,一小时内微调最新热门文生图模型 FLUX

上个月,FLUX 席卷了互联网,这并非没有原因。他们声称优于 DALLE 3、Ideogram 和 Stable Diffusion 3 等模型,而这一点已被证明是有依据的。随着越来越多的流行图像生成工具(如 Stable Diffusion Web UI Forge 和 ComyUI)开始支持这些模型,FLUX 在 Stable Diffusion 领域的扩展将会持续下去。 自 FLU