AI 绘画快速开始-StableDiffusionWebui

news2024/7/30 8:37:00

文章目录

    • 介绍
    • 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

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

在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1305531.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Armv8/Armv9从入门到精通-课程介绍

通知&#xff0c;Arm二期&#xff0c;咱们也有大合集PDF了&#xff0c;共计1587页&#xff0c;还未完成&#xff0c;后续持续更新和优化中。为了方便大家阅读、探讨、做笔记&#xff0c;特意整了此合集PPT&#xff0c;为了增加标签目录&#xff0c;还特意开了福兮阅读器会员。 …

Aduino实现音频频谱效果

看到这样一个效果,于是想用arduino实现类似效果。需要的组件如下 1 arduino开发板 2 音频传感器 3 灯带 接线图如图 代码如下 #include <EEPROM.h>#include <Adafruit_NeoPixel.h>#define PIN 2 // input pin Neopixel is attached to#define NUMPIXELS …

优雅玩转实验室服务器(三)vscode is all you need

在前两章解决了传输问题和连接问题后&#xff0c;我们紧接着遇到一个新的需求&#xff1a;我们需要coding呀&#xff0c;你当然可以说&#xff0c;我们可以用vim和对应的插件来搭建一个IDE呀&#xff0c;fine&#xff0c;我甚至可以给你推荐如下的教程&#xff1a; Vim 到底可…

Java - Math类的常用方法及练习

目录 1.1 概述 1.2 常用方法 ❓面试题&#xff1a;为啥Math.round(-1.5)-1? 1.1 概述 java.lang.Math 类包含用于执行基本数学运算的方法&#xff0c;如初等指数、对数、平方根和三角函数。类似这样的工具类&#xff0c;其所有方法均为静态方法&#xff0c;并且不会创建对象…

包装类 和 初阶泛型(详解)

【本节目标】 1. 以能阅读 java 集合源码为目标学习泛型 2. 掌握包装类 3. 掌握泛型 1. 包装类 在Java中&#xff0c;由于基本类型不是继承自Object&#xff0c;为了在泛型代码中可以支持基本类型&#xff0c;Java给每个基本类型都对应了一个包装类型。 除了Integer和Charact…

MySQL笔记-第08章_聚合函数

视频链接&#xff1a;【MySQL数据库入门到大牛&#xff0c;mysql安装到优化&#xff0c;百科全书级&#xff0c;全网天花板】 文章目录 第08章_聚合函数1. 聚合函数介绍1.1 AVG和SUM函数1.2 MIN和MAX函数1.3 COUNT函数 2. GROUP BY2.1 基本使用2.2 使用多个列分组2.3 GROUP BY中…

云音乐大模型 Agent 探索实践

一. 前言 本篇文章介绍了大语言模型时代下的 AI Agent 概念&#xff0c;并以 LangChain 为例详细介绍了 AI Agent 背后的实现原理&#xff0c;随后展开介绍云音乐在实践 AI Agent 过程中的遇到的问题及优化手段。通过阅读本篇文章&#xff0c;读者将掌握业界主流的 AI Agent 实…

【C进阶】C程序是怎么运作的呢?-- 程序环境和预处理(下)

前言&#xff1a; 这是程序环境和预处理的下半篇文章。至此&#xff0c;关于c语言知识点:从编译到运行的过程已讲解完毕。传送&#x1f6aa;&#xff0c;上半篇&#xff1a; http://t.csdnimg.cn/hvxmr 本章涉及的知识点&#xff1a; 宏和函数对比、命名约定、#undef、命令行定…

【算法每日一练]-结构优化(保姆级教程 篇5 树状数组)POJ3067日本 #POJ3321苹果树 #POJ2352星星 #快排变形

目录 今天知识点 求交点转化求逆序对&#xff0c;每次操作都维护一个y点的前缀和 树的变动转化成一维数组的变动&#xff0c;利用时间戳将节点转化成区间 离散化数组来求逆序对数 先将y排序&#xff0c;然后每加入一个就点更新求一次前缀和 POJ3067&#xff1a;日本 思路&…

关于学习计算机的心得与体会

也是隔了一周没有发文了&#xff0c;最近一直在准备期末考试&#xff0c;后来想了很久&#xff0c;学了这么久的计算机&#xff0c;这当中有些收获和失去想和各位正在和我一样在学习计算机的路上的老铁分享一下&#xff0c;希望可以作为你们碰到困难时的良药。先叠个甲&#xf…

scala编码

1、Scala高级语言 Scala简介 Scala是一门类Java的多范式语言&#xff0c;它整合了面向对象编程和函数式编程的最佳特性。具体来讲Scala运行于Java虚拟机&#xff08;JVM)之上&#xff0c;井且兼容现有的Java程序&#xff0c;同样具有跨平台、可移植性好、方便的垃圾回收等特性…

大数据技术6:大数据技术栈

前言&#xff1a;大数据相关的技术名词特别多&#xff0c;这些技术栈之间的关系是什么&#xff0c;对初学者来说很难找到抓手。我一开始从后端转大数据的时候有点懵逼&#xff0c;整体接触了一遍之后才把大数据技术栈给弄明白了。 一、大数据技术栈 做大数据开发&#xff0c;无…

12.12作业

头文件 #ifndef WIDGET_H #define WIDGET_H#include <QWidget> #include <QTimerEvent> #include <QTime> #include <QtTextToSpeech>QT_BEGIN_NAMESPACE namespace Ui { class Widget; } QT_END_NAMESPACEclass Widget : public QWidget {Q_OBJECT…

Linux:gdb的简单使用

个人主页 &#xff1a; 个人主页 个人专栏 &#xff1a; 《数据结构》 《C语言》《C》《Linux》 文章目录 前言一、前置理解二、使用总结 前言 gdb是Linux中的调试代码的工具 一、前置理解 我们都知道要调试一份代码&#xff0c;这份代码的发布模式必须是debug。那你知道在li…

揭秘高效大型语言模型:技术、方法与应用展望

近年来&#xff0c;大型语言模型&#xff08;LLMs&#xff09;在自然语言处理领域取得了显著的进展&#xff0c;如GPT-series(GPT-3, GPT-4)、Google-series(Gemini, PaLM), Meta-series(LLAMA1&2), BLOOM, GLM等模型在各种任务中展现出惊人的能力。然而&#xff0c;随着模…

2-Spring

2-Spring 文章目录 2-Spring项目源码地址Spring概述Spring特点&#xff08;优点&#xff09;Spring相关学习网站基于Maven的Spring框架导入Spring的组成及拓展 Spring-IOC--原型理解IOC-原型--示例开发示例-常规开发示例-Set函数&#xff08;IOC原型&#xff09;开发示例-对比思…

【热】如何实现el-table列宽随内容长度自适应最小宽度

非常火急火燎的来写这篇博客&#xff01;&#xff01;因为自己一开始想实现这个效果时在网上查了很久查了很多资料和博客都没有找到能有效达到效果的方法&#xff0c;要么就是别人说有效但是我这里会报错而且难以解决。最后终于被我自己给摸索出来了&#xff01; 应用场景 很…

AI+无代码助力企业供应链优化

内容来自演讲&#xff1a;潘峰 | 预见明日科技&#xff08;北京&#xff09;有限公司 | CEO 摘要 本文介绍了企业供应链中的挑战和解决方案。文章指出&#xff0c;供应链成本占企业经营成本的大部分&#xff0c;且存在供给端和需求端的高度不确定性。为应对这种不确定性&…

Openwrt源码下载出现“The remote end hung up unexpected”

最近项目原因需要下载openwrt21.02版本源码&#xff0c;花费了很多时间&#xff0c;找到正确方法后&#xff0c;发现可以节省很多时间&#xff0c;记录下过程&#xff0c;方便自己&#xff0c;可能方便他人。 一.问题阐述 openwrt21.02下载链接如下&#xff1a; git clone -…

Uncaught ReferenceError: jQuery is not defined解决方法

当我在写java的Maven项目时&#xff0c;出现了这样的一个报错信息&#xff1a; 我一直找代码&#xff0c;抓包&#xff0c;调试&#xff0c;比对代码 jQuery未定义就是指JS的导包没有导进来&#xff01;&#xff01;&#xff01;&#xff01; 导进来就运行正常啦