当前位置:AIGC资讯 > AIGC > 正文

Stable Diffusion初体验——基于机器学习通过神经网络的强大AI平台

文章目录

前言 最新热门活动!! 平台介绍 一.创建应用 Stable Diffusion WebUI 初始化 上传模型,VAE,lora 介绍sd模型,vae,lora模型 进入应用 文生图 工作区 调参区 图生图 结语 小程序活动——6.20火热上线🔥!!

前言

在这个信息爆炸的时代,AI技术正以前所未有的速度发展着。图生图、AI换脸、图生视频技术的涌入,极大地改变了我们的工作与生活,带来了更多的挑战与机遇。

例如我们可以使用AI去生成具有质感的人物图像

也可以使用实现视频,图片的换脸效果

图生视频也可以轻松实现

图生视频

但是这样的效果与实现需要用到昂贵的显卡,CPU或要占用额外的内存,这里给大家推荐一款非常实用的平台,提供良好的一键开机镜像环境,实现智能算力的灵活、便捷使用;
并给出了新用户提供了免费体验无限图片次数的额度 —— 算力资源,触手可及!

最新热门活动!!

🔥特惠风暴来袭!只需9.9元/周,尽享顶级AI算力!🔥

平台介绍

🎉 海量卡源,开机成功率遥遥领先 🎉
🤖 应用市场,无需部署,开箱即用 🤖
🌟 限时0元体验,一步迈向算力自由 🌟

一.创建应用

我们选择用户界面到应用市场,选择想要的应用

Stable Diffusion WebUI

Stable Diffusion WebUl是基于网页的用户界面,它使得用户可以通过浏览器与Stable Diffusion模型进行交互,生成图像。

初始化


Stable Diffusion是世界领先的开源人工智能。我们在成像、语言、代码和音频方面以最少的资源需求提供突破性的、开放访问的AI模型。

创建应用
到个人中心选择我的应用开机(开机重启并不计算费用)
上传模型,VAE,lora


4. 输入用户名密码

点击至这个文件夹找到对应文件夹


进行上传等待即可

介绍sd模型,vae,lora模型

SD模型(Stable Diffusion)
Stable Diffusion 是一个深度学习模型,专门用于生成高质量的图像。它主要用于文本到图像的生成,即用户输入一段文本描述,模型就能生成与之匹配的图像。Stable Diffusion 模型基于深度学习中的扩散模型,这种模型能够在图像生成的过程中保持较高的稳定性和图像质量。 VAE(变分自编码器)
VAE(Variational Autoencoder)是一种深度学习模型,它属于自编码器的一种。自编码器的主要目的是将输入数据压缩成编码(向量形式),然后再用这些编码重构出原始数据。VAE在自编码器的基础上加入了一个重要的概念——变分推断。VAE通过最大化边际对数似然的下界来进行训练,这使得它能够生成新的数据实例,而不仅仅是重构输入数据。VAE广泛应用于生成模型、数据降维和异常检测等领域。
3.LoRA模型
LoRA(Low-Rank Adaptation)模型是一种模型微调方法,它使得大型预训练模型能够快速适应新的任务或领域。LoRA通过引入一组可训练的、低秩的参数来修改预训练模型中的权重,从而减少了需要微调的参数数量。这种方法大大减少了微调所需的计算资源和时间,同时还能保持模型在新任务上的性能。LoRA在自然语言处理和计算机视觉等领域得到了广泛应用。


SD模型是核心,VAE是渲染效果,lora模型是加强细节

进入应用


我们可以看到缩放之后的界面是这样的
我们来大致的介绍一下

大致地,我们将它分成了模型选择区功能工作区参数调节区,以及控制器出图区
我们可以重点来看一下工作区的内容

文生图

文生图是指通过输入文本描述,让Stable Diffusion模型生成与之匹配的图像。这个过程可能会涉及到模型的推理和图像的生成。用户可以通过在工作区输入文本,然后在调参区调整参数,来生成符合自己需求的图像。

工作区

工作区是用户与平台交互的主要区域。文本输入框和其他用于调整生成参数的控件。用户可以通过工作区实时预览生成的图像,并根据需要调整prompt参数。

这两个内容是进行正向提示词以及反向词的过程

在Stable Diffusion(SD)模型中,正向提示词(positive prompts)和反向提示词(negative
prompts)是用来指导模型生成图像的关键文本描述。
正向提示词是您提供给模型的描述,用于指导模型生成与这些描述相匹配的图像。这些提示词可以是关于图像的内容、风格、情感、色彩等方面的信息。模型会根据这些提示词生成图像。
例子:

“一个宁静的湖边,清晨的阳光照在湖面上,一只鹅在水中静静地游动” “未来主义风格的都市夜景,高楼林立,霓虹闪烁,飞行汽车穿梭其中” “印象派风格的田园风光,大片的花海,远处有农民在劳作”

反向提示词是您提供给模型的描述,用于指导模型避免在生成的图像中出现某些内容或特征。这些提示词可以帮助您排除不希望出现在图像中的元素。
例子:

“没有人物” “不要夜晚,要白天” “不要现代建筑,要古代建筑” “不要冷色调,要暖色调” 通过结合使用正向提示词和反向提示词,您可以更精确地控制SD模型生成图像的方向,以获得更符合您期望的结果。

我们可以看到它内置了,提示词翻译,GPT等工具


点击这里,即可看到它以及给出了很多的提示词

我们可以来尝试一下,选择一个女孩

就可以很轻松地得到一张图片

我们可以在反向提示词中选择一些现有的词
例如:

(worst quality:2),(low quality:2),(normal quality:2),lowres,watermark,nsfw,blurry,bad anatomy,bad proportions,out of focus,worstquality,


我们可以看一下它翻译出来的内容

就可以得到这样的效果

我们可以对它进行一个AI的修改
添加一个
画质

(masterpiece, top quality, best quality, official art, beautiful and aesthetic:1.2),

装饰

extremely detailed,(fractal art:1.1),(colorful:1.1)(flowers:1.3),highest detailed,(zentangle:1.2),(dynamic pose),(abstract background:1.3),(many colors:1.4),(earrings),(feathers:1.5).,

我们可以得到

我们这里可以给出一些通用的人物的反向prompt供大家使用

bad face, bad anatomy, bad proportions, bad perspective, multiple views, concept art, reference sheet, mutated hands and fingers, interlocked fingers, twisted fingers, excessively bent fingers, more than five fingers, lowres, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, artist name, low quality lowres multiple breasts, low quality lowres mutated hands and fingers, more than two arms, more than two hands, more than two legs, more than two feet, low quality lowres long body, low quality lowres mutation poorly drawn, low quality lowres black-white, low quality lowres bad anatomy, low quality lowres liquid body, low quality lowres liquid tongue, low quality lowres disfigured, low quality lowres malformed, low quality lowres mutated, low quality lowres anatomical nonsense, low quality lowres text font ui, low quality lowres error, low quality lowres malformed hands, low quality lowres long neck, low quality lowres blurred, low quality lowres lowers, low quality lowres low res, low quality lowres bad proportions, low quality lowres bad shadow, low quality lowres uncoordinated body, low quality lowres unnatural body, low quality lowres fused breasts, low quality lowres bad breasts, low quality lowres huge breasts, low quality lowres poorly drawn breasts, low quality lowres extra breasts, low quality lowres liquid breasts, low quality lowres heavy breasts, low quality lowres missing breasts, low quality lowres huge haunch, low quality lowres huge thighs, low quality lowres huge calf, low quality lowres bad hands, low quality lowres fused hand, low quality lowres missing hand, low quality lowres disappearing arms, low quality lowres disappearing thigh, low quality lowres disappearing calf, low quality lowres disappearing legs, low quality lowres fused ears, low quality lowres bad ears, low quality lowres poorly drawn ears, low quality lowres extra ears, low quality lowres liquid ears, low quality lowres heavy ears, low quality lowres missing ears, low quality lowres fused animal ears, low quality lowres bad animal ears, low quality lowres poorly drawn animal ears, low quality lowres extra animal ears, low quality lowres liquid animal ears, low quality lowres heavy animal ears, low quality lowres missing animal ears, low quality lowres text, low quality lowres ui, low quality lowres missing fingers, low quality lowres missing limb, low quality lowres fused fingers, low quality lowres one hand with more than 5 fingers, low quality lowres one hand with less than 5 fingers, low quality lowres one hand with more than 5 digit, low quality lowres one hand with less than 5 digit, low quality lowres extra digit, low quality lowres fewer digits, low quality lowres fused digit, low quality lowres missing digit, low quality lowres bad digit, low quality lowres liquid digit, low quality lowres colorful tongue, low quality lowres black tongue, low quality lowres cropped, low quality lowres watermark, low quality lowres username, low quality lowres blurry, low quality lowres JPEG artifacts, low quality lowres signature, low quality lowres 3D, low quality lowres 3D game, low quality lowres 3D game scene, low quality lowres 3D character, low quality lowres malformed feet, low quality lowres extra feet, low quality lowres bad feet, low quality lowres poorly drawn feet, low quality lowres fused feet, low quality lowres missing feet, low quality lowres extra shoes, low quality lowres bad shoes, low quality lowres fused shoes, low quality lowres more than two shoes, low quality lowres poorly drawn shoes, low quality lowres bad gloves, low quality lowres poorly drawn gloves, low quality lowres fused gloves, low quality lowres bad cum, low quality lowres poorly drawn cum, low quality lowres fused cum, low quality lowres bad hairs, low quality lowres poorly drawn hairs, low quality lowres fused hairs, low quality lowres big muscles, low quality lowres ugly, low quality lowres bad face, low quality lowres fused face, low quality lowres poorly drawn face, low quality lowres cloned face, low quality lowres big face, low quality lowres long face, low quality lowres bad eyes, low quality lowres fused eyes poorly drawn eyes, low quality lowres extra eyes, low quality lowres malformed limbs, low quality lowres more than 2 nipples, low quality lowres missing nipples, low quality lowres different nipples, low quality lowres fused nipples, low quality lowres bad nipples, low quality lowres poorly drawn nipples, low quality lowres black nipples, low quality lowres colorful nipples, low quality lowres gross proportions, short arm, low quality lowres missing arms, low quality lowres missing thighs, low quality lowres missing calf, low quality lowres missing legs, low quality lowres mutation, low quality lowres duplicate, low quality lowres morbid, low quality lowres mutilated, low quality lowres poorly drawn hands, low quality lowres more than 1 left hand, low quality lowres more than 1 right hand, low quality lowres deformed, low quality lowres extra arms, low quality lowres extra thighs, low quality lowres more than 2 thighs, low quality lowres extra calf, low quality lowres fused calf, low quality lowres extra legs, low quality lowres bad knee, low quality lowres extra knee, low quality lowres more than 2 legs, low quality lowres bad tails, low quality lowres bad mouth, low quality lowres fused mouth, low quality lowres poorly drawn mouth, low quality lowres bad tongue, low quality lowres tongue within mouth, low quality lowres too long tongue, low quality lowres big mouth, low quality lowres cracked mouth, low quality lowres dirty face, low quality lowres dirty teeth, low quality lowres dirty pantie, low quality lowres fused pantie, low quality lowres poorly drawn pantie, low quality lowres fused cloth, low quality lowres poorly drawn cloth, low quality lowres bad pantie, low quality lowres yellow teeth, low quality lowres thick lips, low quality lowres bad asshole, low quality lowres poorly drawn asshole, low quality lowres fused asshole, low quality lowres missing asshole, low quality lowres bad anus, low quality lowres bad pussy, low quality lowres bad crotch, low quality lowres bad crotch seam, low quality lowres fused anus, low quality lowres fused pussy, low quality lowres fused crotch, low quality lowres poorly drawn crotch, low quality lowres fused seam, low quality lowres poorly drawn anus, low quality lowres poorly drawn pussy, low quality lowres poorly drawn crotch seam, low quality lowres bad thigh gap, low quality lowres missing thigh gap, low quality lowres fused thigh gap, low quality lowres liquid thigh gap, low quality lowres poorly drawn thigh gap, low quality lowres bad collarbone, low quality lowres fused collarbone, low quality lowres missing collarbone, low quality lowres liquid collarbone, low quality lowres strong girl, low quality lowres obesity, low quality lowres worst quality, low quality lowres low quality, low quality lowres normal quality, low quality lowres liquid tentacles, low quality lowres bad tentacles, low quality lowres poorly drawn tentacles, low quality lowres split tentacles, low quality lowres fused tentacles, low quality lowres missing clit, low quality lowres bad clit, low quality lowres fused clit, low quality lowres colorful clit, low quality lowres black clit, low quality lowres liquid clit, low quality lowres QR code, low quality lowres bar code, low quality lowres censored, low quality lowres safety panties, low quality lowres safety knickers, low quality lowres beard, low quality lowres furry, pony, low quality lowres pubic hair, low quality lowres mosaic, low quality lowres excrement, low quality lowres shit, low quality lowres futa, low quality lowres testis, low quality lowres lowres, low quality lowres terrible, low quality lowres dirty, low quality lowres feces, low quality lowres organs, low quality lowres fat, low quality lowres thick thighs, low quality lowres low resolution rough, low quality lowres pedophile, low quality lowres bestiality, low quality lowres parody, low quality lowres traditional media, low quality lowres koma, low quality lowres comic, low quality lowres scary, low quality lowres severe, low quality lowres insects, low quality lowres gross scars, low quality lowres twisted human body, low quality lowres irrational human body, low quality lowres sharp fingers, low quality lowres parts of the body out of common sense, low quality lowres murder, low quality lowres beheading, low quality lowres zombie, low quality lowres mummy, low quality lowres graffiti, low quality lowres unfinished picture, low quality lowres terrible quality, low quality lowres Coprophilia, low quality lowres muscular, low quality lowres bald, low quality lowres monk, low quality lowres wrinkly, low quality lowres simple background, low quality lowres realistic, low quality lowres old, low quality lowres scan, low quality lowres touhou, low quality lowres yaoi, low quality lowres gay, low quality lowres femboy, low quality lowres trap, low quality lowres pee, low quality lowres doujinshi, low quality lowres monochrome, low quality lowres meme, low quality lowres demon, low quality lowres monstrous creature, low quality lowres tentacle, low quality lowres self harm, low quality lowres vomit, low quality lowres suicide, low quality lowres death, low quality lowres corpse, low quality lowres bone, low quality lowres skeleton, low quality lowres fingers over 6, low quality lowres framed, low quality lowres historical picture, low quality lowres futanari, low quality lowres shemale, low quality lowres transgender, low quality lowres dick girl, low quality lowres flat breasts, low quality lowres degenerate ass, low quality lowres retro artstyle, low quality lowres anime screencap, low quality lowres stitched, low quality lowres pokemon, low quality lowres ryona, low quality lowres animal, low quality lowres male focus, low quality lowres nipple penetration, low quality lowres sonic \(series\), low quality lowres bondage, low quality lowres bdsm, low quality lowres 2D, low quality lowres 2D game, low quality lowres 2D game scene, low quality lowres 2D character, low quality lowres game cg, low quality lowres watercolor \(medium\), low quality lowres 2koma, low quality lowres interlocked fingers, low quality lowres gloves, low quality lowres nitroplus, low quality lowres grayscale, low quality lowres sketch, low quality lowres line drawing, low quality lowres gorilla, low quality lowres meat, low quality lowres gundam, low quality lowres multiple views, low quality lowres cut, low quality lowres concept art, low quality lowres reference sheet, low quality lowres turnaround, low quality lowres chart, low quality lowres comparison, low quality lowres artist progress, low quality lowres lineup, low quality lowres before and after, low quality lowres orc, low quality lowres tusks, low quality lowres goblin, low quality lowres kobold, low quality lowres pony, low quality lowres nsfw, low quality lowres Humpbacked, low quality lowres text error, low quality lowres extra digits, low quality lowres standard quality, low quality lowres large breasts, low quality lowres shadow, low quality lowres nude, low quality lowres artist name, low quality lowres skeleton girl, low quality lowres bad legs, low quality lowres missing fingers, low quality lowres extra digit, low quality lowres artifacts, low quality lowres bad body, low quality lowres optical illusion, low quality lowres Glasses, low quality lowres girl, low quality lowres women, low quality lowres more than 1 moon, low quality lowres Multi foot, low quality lowres Multifold, low quality lowres Multi fingering, low quality lowres colored sclera, low quality lowres monster girl, low quality lowres Black hands, low quality lowres The background is incoherent, low quality lowres abnormal eye proportion, low quality lowres Abnormal hands, low quality lowres abnormal legs, low quality lowres abnormal feet abnormal fingers, low quality lowres sharp face, low quality lowres tranny, low quality lowres mutated hands, low quality lowres extra limbs, low quality lowres too many fingers, low quality lowres unclear eyes, low quality lowres bad, low quality lowres mutated hand and finger, low quality lowres malformed mutated, low quality lowres broken limb, low quality lowres incorrect limb, low quality lowres fusion finger, low quality lowres lose finger, low quality lowres multiple finger, low quality lowres multiple digit, low quality lowres fusion hand, low quality lowres lose leg, low quality lowres fused leg, low quality lowres multiple leg, low quality lowres bad cameltoe, low quality lowres colorful cameltoe, low quality lowres low polygon 3D game, (over three finger\(fingers excluding thumb\):2), (fused anatomy), (bad anatomy\(body\)), (bad anatomy\(hand\)), (bad anatomy\(finger\)), (over four fingers\(finger\):2), (bad anatomy\(arms\)), (over two arms\(body\)), (bad anatomy\(leg\)), (over two legs\(body\)), (interrupted\(body, arm, leg, finger, toe\)), (bad anatomy\(arm\)), (bad detail\(finger\):1.2), (bad anatomy\(fingers\):1.2), (multiple\(fingers\):1.2), (bad anatomy\(finger\):1.2), (bad anatomy\(fingers\):1.2), (fused\(fingers\):1.2), (over four fingers\(finger\):2), (multiple\(hands\)), (multiple\(arms\)), (multiple\(legs\)), (over three toes\(toes excluding big toe\):2), (bad anatomy\(foot\)), (bad anatomy\(toe\)), (over four toes\(toe\):2), (bad detail\(toe\):1.2), (bad anatomy\(toes\):1.2), (multiple\(toes\):1.2), (bad anatomy\(toe\):1.2), (bad anatomy\(toes\):1.2), (fused\(toes\):1.2), (over four toes\(toe\):2), (multiple\(feet\)),fat,

调参区

调参区允许用户调整参数,以影响图像生成的结果。这些参数可能包括图像的分辨率、风格、细节程度等。用户可以根据自己的需求,调整这些参数,以达到最佳的图像生成效果。

在Stable Diffusion(SD)模型中,迭代步数和采样方法是影响图像生成过程和结果质量的重要因素。

迭代步数是指在生成图像时,模型对图像进行逐步细化处理的次数。每一步,模型都会根据当前的图像状态和给定的提示词进行调整,逐渐从噪声中生成出清晰的图像。迭代步数越多,模型对图像的调整就越精细,通常能够生成质量更高的图像。但是,增加迭代步数也会导致生成图像所需的时间更长。

在SD模型中,迭代步数通常有一个默认值,比如7-25步,用户可以根据需要调整这个值。如果需要更快的生成速度,可以选择较少的迭代步数;如果需要更高质量的图像,可以选择更多的迭代步数。

采样方法是指在图像生成过程中,模型如何从潜在空间(latent space)中采样像素值的方法。不同的采样方法会影响图像生成的速度、稳定性和最终图像的视觉质量。
Stable Diffusion模型通常使用以下几种采样方法:

Euler方法:这是一种较快的采样方法,但它可能会在图像生成过程中引入更多的噪声。 Euler Ancestral (Euler a)方法:这是Euler方法的变种,它在保持较快生成速度的同时,通常能够提供比纯Euler方法更稳定的图像质量。 Heun方法:这是一种比Euler方法更稳定的采样方法,它通过在每一步中使用两个预测来提高图像质量,但生成速度可能会稍慢。 DPM-solver方法:这是一种较新的采样方法,它结合了不同的数值解算器来优化采样过程,通常能够在保持较快生成速度的同时提供高质量的图像。 LMS方法:这是一种基于自适应步长的采样方法,它可以根据当前的图像状态动态调整采样步长,以平衡生成速度和图像质量。 用户可以根据自己的需求选择合适的采样方法。例如,如果需要快速生成图像,可以选择Euler方法;如果需要高图像质量,可以选择DPM-solver或Heun方法。在实际应用中,用户可以通过实验来确定哪种组合能够最好地满足自己的需求。

我们可以得到一个更具细节的图片

图生图

图生图是指利用Stable Diffusion模型的一种特殊模式,即根据已有的图像生成新的图像。这可以通过模型对原图像的理解和扩展来实现。用户可以通过上传一张图像,然后在工作区输入新的文本描述,让模型根据原图像生成新的图像。

我们首先可以准备一张图片,例如一只老虎

我们帮它放到图生图中

同理,我们进行调节:

注意的是,重绘幅度大于7就和原图差距就很大了,则调整到0.7以内在进行调节

我们可以描述一下:

动物看起来正直接面向观看者,张大嘴巴,展现出黄色的眼睛。这个生物非人类,它的眼睛和周围都发出光芒,拥有锋利的獠牙,仿佛口中喷吐着火焰。整个场景中充满了爆炸效果,仿佛虎形态的生物正置身于一片火海之中,四周飘散着火星和熔融的岩石。整个画面采用了电影式的光影效果,对比度强烈,细节处理极为精致,是一幅高质量、高清晰度的杰作。这幅作品将现实主义推向了极致,拥有细腻的质感和难以置信的逼真度。

prompt:

Hyperrealistic art BJ_Sacred_beast,looking_at_viewer,open_mouth,yellow_eyes,no_humans,glowing,animal,fangs,fire,glowing_eyes,explosion,tiger,embers,molten_rock,,cinematic lighting,strong contrast,high level of detail,Best quality,masterpiece,Extremely high-resolution details,photographic,realism pushed to extreme,fine texture,incredibly lifelike,Extremely high-resolution details, photographic, realism pushed to extreme, fine texture, incredibly lifelike  

同样地我们去写一些负面:

simplified, abstract, unrealistic, impressionistic, low resolution, embedding:BadDream,embedding:FastNegativeV2,

我们可以看到它的效果:

在这里我们可以选择一下模型:

我们就可以得到一个十分帅气的老虎图片

同样的:

我们可以拿这张图片,可以得到很多的动物:例如狮子,豹子


只需要略微修改提示词就可以了

结语

Stable Diffusion 是一个先进的图像生成模型,它能够在强大的硬件支持下,如 RTX 4090 GPU,提供快速且高质量的图像生成体验。在使用该平台时,用户首先需要在平台上选择并创建一个应用,然后上传所需的模型,如 SD 模型、vae 和 lora 模型。这些模型是图像生成的核心,它们决定了生成的图像的风格和质量。

一旦模型上传并初始化完成后,用户就可以进入应用开始生成图像。用户界面通常分为工作区和调参区。工作区是用户与模型交互的主要区域,可以输入文本提示(prompt),上传参考图像,以及预览生成的图像。调参区则允许用户调整各种参数,如图像的分辨率、生成步骤、采样器等,以微调生成的图像。

在平台提供的强大算力下,Stable Diffusion 能够快速生成图像,提供良好的速度和效果体验。用户在熟悉了基本操作后,可以尝试不同的文本提示组合,探索和体验绘制各种风格和主题的图片。

小程序活动——6.20火热上线🔥!!

🔥特惠风暴来袭!只需9.9元/周,尽享顶级AI算力!🔥

更新时间 2024-06-18