Stable Diffusion|高效批量处理图片全流程,保姆级教程吐血整理

随着人工智能技术的飞速发展,AI绘画已经从科幻概念逐渐变为现实,并广泛应用于艺术、设计、娱乐等多个领域。在这样一个技术革新的背景下,如何高效地生成大量优质的AI绘画作品,成为了一个亟待解决的问题。批量处理技术的引入,为解决这一难题提供了可能。

在这里插入图片描述

AI绘画图生图批量处理,是指通过自动化和智能化的手段,对大量的图像数据或输入指令进行批量化的处理和生成,从而快速产出大量的AI绘画作品。这一技术的核心在于将AI绘画的生成过程进行标准化、流程化,并利用计算机强大的计算能力,实现快速、高效的批量生成。

今天就带给大家批量图生图的全教程。

01.基本用法

我们打开webUI,在图生图页面下我们能找到批量处理的菜单

在这里插入图片描述

最简单的批量处理方法只需要用到输入目录和输出目录两个功能

第一步你需要建立一个输入目录的文件夹,注意不要用中文路径

然后将要重绘的图片编号序号放到这个文件夹内

接着我们将这个目录的路径粘贴到输入目录

在这里插入图片描述

然后我们再建立一个文件夹用作输出图片用,注意路径也不要有中文

将这个文件夹的路径粘贴到输出目录

以上设置好之后我们就可以正常选择绘画模型,写你想要绘制的提示词和设置参数了。

例如我想要重绘的是皮卡丘跳舞,那我就在正向提示词中写入一只皮卡丘在跳舞这个提示词。

接着我在下方设置重绘参数,注意你的重绘尺寸的宽高比例要跟你要重绘的图片一致

最后我们点击生图,在输出的文件夹就会出现重绘后的图片了,注意如果你输出文件夹没有出现重绘图你可以重新打开webUI尝试。

但是我们发现现在重绘的皮卡丘跟原图有点对不上,为了提高重绘的精度我们还需要学习下面这些进阶功能。

#02

/重绘蒙版

首先我们要知道什么是重绘蒙版,重绘蒙版可以帮助我们更精细地控制重绘画面中元素的范围,例如我只想重绘皮卡丘而让图像的背景保持不变。

首先我们要使用专业的图像处理工具把图片处理为下图形式

给每张要重绘的图片绘制重绘蒙版

注意白色区域是替换,黑色区域是保留不变的。

我们将蒙版文件的目录贴入批量重绘蒙版目录

大家可以勾选这个Soft inpainting会让生成的图片过渡更加自然

这张没有勾选能看到边缘过渡很硬

这个勾选后的边缘就和缓多了。

最终我们在输出文件夹内就获得了我们用重绘蒙版获得的图片,可以看到背景跟原图基本保持了一致,只有皮卡丘被重绘了。

03.批量处理中使用controlnet

为了让重绘的图片中皮卡丘的动作更加贴近原图,在这里我们可以使用controlnet来批量重绘。

首先我打开controlnet点击启动、完美像素模式和上传独立控制的图像后选择批量处理,控制类型选择硬边缘,注意这里的目录可以先空着。

为了更好的控制图像,我再增加一个controlnet,控制类型选择深度,输入目录同样不填。

然后我们回到上面的批量重绘那里,将原图的地址输入到这个controlnet输入目录这里

最后我们就生成跟原图比较接近的重绘图像啦,经过我的测试利用controlnet来批量重绘比重绘蒙版更方便效果也更好一些。

04.批量处理中使用png图片信息

png图片信息适合你重绘不同的场景时使用,例如我们要重绘三张图,分别为一个皮卡丘、一棵树和一个初音未来。

然后我针对这三个元素各自先用文生图生成一张图片

a pikachu,in the dance,best quality,masterpiece,best quality,

a tree,best quality,masterpiece,HDR,UHD,8K,best quality,masterpiece,

hatsune miku,best quality,masterpiece,HDR,UHD,8K,best quality,masterpiece,

将这三张携带有png信息的图片放置到一个文件夹内

然后我们将目录填入png图片信息目录,打钩提示词、反向提示词、采样方法、迭代步数,并清空图生图的提示词

最后我们生图看一下效果:

原图

重绘后

原图

重绘后

原图

重绘后

AI绘画图生图批量处理是一项具有创新性和实用性的技术,它将为艺术创作、设计、娱乐等领域带来革命性的变革。随着技术的不断发展和完善,我们有理由相信,未来的AI绘画将会更加智能化、个性化,并为我们带来更加丰富、多样的艺术体验。

资料软件免费放送

次日同一发放请耐心等待

关于AI绘画技术储备

学好 AI绘画 不论是就业还是做副业赚钱都不错,但要学会 AI绘画 还是要有一个学习规划。最后大家分享一份全套的 AI绘画 学习资料,给那些想学习 AI绘画 的小伙伴们一点帮助!

感兴趣的小伙伴,赠送全套AIGC学习资料和安装工具,包含AI绘画、AI人工智能等前沿科技教程,模型插件,具体看下方。

需要的可以扫描下方CSDN官方认证二维码免费领取【保证100%免费】

在这里插入图片描述

一、AIGC所有方向的学习路线

AIGC所有方向的技术点做的整理,形成各个领域的知识点汇总,它的用处就在于,你可以按照下面的知识点去找对应的学习资源,保证自己学得较为全面。

在这里插入图片描述

在这里插入图片描述

二、AIGC必备工具

工具都帮大家整理好了,安装就可直接上手!
在这里插入图片描述

三、最新AIGC学习笔记

当我学到一定基础,有自己的理解能力的时候,会去阅读一些前辈整理的书籍或者手写的笔记资料,这些笔记详细记载了他们对一些技术点的理解,这些理解是比较独到,可以学到不一样的思路。
在这里插入图片描述
在这里插入图片描述

四、AIGC视频教程合集

观看全面零基础学习视频,看视频学习是最快捷也是最有效果的方式,跟着视频中老师的思路,从基础到深入,还是很容易入门的。

在这里插入图片描述

五、实战案例

纸上得来终觉浅,要学会跟着视频一起敲,要动手实操,才能将自己的所学运用到实际当中去,这时候可以搞点实战案例来学习。
在这里插入图片描述
这份完整版的学习资料已经上传CSDN,朋友们如果需要可以微信扫描下方CSDN官方认证二维码免费领取【保证100%免费】

在这里插入图片描述

Version: ImageMagick 6.7.6-7 2012-04-20 Q16 http://www.imagemagick.org Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC Features: OpenMP Usage: convert.exe [options ...] file [ [options ...] file ...] [options ...] file Image Settings: -adjoin join images into a single multi-image file -affine matrix affine transform matrix -alpha option activate, deactivate, reset, or set the alpha channel -antialias remove pixel-aliasing -authenticate password decipher image with this password -attenuate value lessen (or intensify) when adding noise to an image -background color background color -bias value add bias when convolving an image -black-point-compensation use black point compensation -blue-primary point chromaticity blue primary point -bordercolor color border color -caption string assign a caption to an image -channel type apply option to select image channels -colors value preferred number of colors in the image -colorspace type alternate image colorspace -comment string annotate image with comment -compose operator set image composite operator -compress type type of pixel compression when writing the image -define format:option define one or more image format options -delay value display the next image after pausing -density geometry horizontal and vertical density of the image -depth value image depth -direction type render text right-to-left or left-to-right -display server get image or font from this X server -dispose method layer disposal method -dither method apply error diffusion to image -encoding type text encoding type -endian type endianness (MSB or LSB) of the image -family name render text with this font family -fill color color to use when filling a graphic primitive -filter type use this filter when resizing an image -font name render text with this font -format "string" output formatted image characteristics -fuzz distance colors within this distance are considered equal -gravity type horizontal and vertical text placement -green-primary point chromaticity green primary point -intent type type of rendering intent when managing the image color -interlace type type of image interlacing scheme -interline-spacing value set the space between two text lines -interpolate method pixel color interpolation method -interword-spacing value set the space between two words -kerning value set the space between two letters -label string assign a label to an image -limit type value pixel cache resource limit -loop iterations add Netscape loop extension to your GIF animation -mask filename associate a mask with the image -mattecolor color frame color -monitor monitor progress -orient type image orientation -page geometry size and location of an image canvas (setting) -ping efficiently determine image attributes -pointsize value font point size -precision value maximum number of significant digits to print -preview type image preview type -quality value JPEG/MIFF/PNG compression level -quiet suppress all warning messages -red-primary point chromaticity red primary point -regard-warnings pay attention to warning messages -remap filename transform image colors to match this set of colors -respect-parentheses settings remain in effect until parenthesis boundary -sampling-factor geometry horizontal and vertical sampling factor -scene value image scene number -seed value seed a new sequence of pseudo-random numbers -size geometry width and height of image -stretch type render text with this font stretch -stroke color graphic primitive stroke color -strokewidth value graphic primitive stroke width -style type render text with this font style -synchronize synchronize image to storage device -taint declare the image as modified -texture filename name of texture to tile onto the image background -tile-offset geometry tile offset -treedepth value color tree depth -transparent-color color transparent color -undercolor color annotation bounding box color -units type the units of image resolution -verbose print detailed information about the image -view FlashPix viewing transforms -virtual-pixel method virtual pixel access method -weight type render text with this font weight -white-point point chromaticity white point Image Operators: -adaptive-blur geometry adaptively blur pixels; decrease effect near edges -adaptive-resize geometry adaptively resize image using 'mesh' interpolation -adaptive-sharpen geometry adaptively sharpen pixels; increase effect near edges -alpha option on, activate, off, deactivate, set, opaque, copy transparent, extract, background, or shape -annotate geometry text annotate the image with text -auto-gamma automagically adjust gamma level of image -auto-level automagically adjust color levels of image -auto-orient automagically orient (rotate) image -bench iterations measure performance -black-threshold value force all pixels below the threshold into black -blue-shift factor simulate a scene at nighttime in the moonlight -blur geometry reduce image noise and reduce detail levels -border geometry surround image with a border of color -bordercolor color border color -brightness-contrast geometry improve brightness / contrast of the image -cdl filename color correct with a color decision list -charcoal radius simulate a charcoal drawing -chop geometry remove pixels from the image interior -clamp restrict pixel range from 0 to the quantum depth -clip clip along the first path from the 8BIM profile -clip-mask filename associate a clip mask with the image -clip-path id clip along a named path from the 8BIM profile -colorize value colorize the image with the fill color -color-matrix matrix apply color correction to the image -contrast enhance or reduce the image contrast -contrast-stretch geometry improve contrast by `stretching' the intensity range -convolve coefficients apply a convolution kernel to the image -cycle amount cycle the image colormap -decipher filename convert cipher pixels to plain pixels -deskew threshold straighten an image -despeckle reduce the speckles within an image -distort method args distort images according to given method ad args -draw string annotate the image with a graphic primitive -edge radius apply a filter to detect edges in the image -encipher filename convert plain pixels to cipher pixels -emboss radius emboss an image -enhance apply a digital filter to enhance a noisy image -equalize perform histogram equalization to an image -evaluate operator value evaluate an arithmetic, relational, or logical expression -extent geometry set the image size -extract geometry extract area from image -fft implements the discrete Fourier transform (DFT) -flip flip image vertically -floodfill geometry color floodfill the image with color -flop flop image horizontally -frame geometry surround image with an ornamental border -function name parameters apply function over image values -gamma value level of gamma correction -gaussian-blur geometry reduce image noise and reduce detail levels -geometry geometry preferred size or location of the image -identify identify the format and characteristics of the image -ift implements the inverse discrete Fourier transform (DFT) -implode amount implode image pixels about the center -lat geometry local adaptive thresholding -layers method optimize, merge, or compare image layers -level value adjust the level of image contrast -level-colors color,color level image with the given colors -linear-stretch geometry improve contrast by `stretching with saturation' -liquid-rescale geometry rescale image with seam-carving -median geometry apply a median filter to the image -mode geometry make each pixel the 'predominant color' of the neighborhood -modulate value vary the brightness, saturation, and hue -monochrome transform image to black and white -morphology method kernel apply a morphology method to the image -motion-blur geometry simulate motion blur -negate replace every pixel with its complementary color -noise geometry add or reduce noise in an image -normalize transform image to span the full range of colors -opaque color change this color to the fill color -ordered-dither NxN add a noise pattern to the image with specific amplitudes -paint radius simulate an oil painting -polaroid angle simulate a Polaroid picture -posterize levels reduce the image to a limited number of color levels -profile filename add, delete, or apply an image profile -quantize colorspace reduce colors in this colorspace -radial-blur angle radial blur the image -raise value lighten/darken image edges to create a 3-D effect -random-threshold low,high random threshold the image -region geometry apply options to a portion of the image -render render vector graphics -repage geometry size and location of an image canvas -resample geometry change the resolution of an image -resize geometry resize the image -roll geometry roll an image vertically or horizontally -rotate degrees apply Paeth rotation to the image -sample geometry scale image with pixel sampling -scale geometry scale the image -segment values segment an image -selective-blur geometry selectively blur pixels within a contrast threshold -sepia-tone threshold simulate a sepia-toned photo -set property value set an image property -shade degrees shade the image using a distant light source -shadow geometry simulate an image shadow -sharpen geometry sharpen the image -shave geometry shave pixels from the image edges -shear geometry slide one edge of the image along the X or Y axis -sigmoidal-contrast geometry increase the contrast without saturating highlights or shadows -sketch geometry simulate a pencil sketch -solarize threshold negate all pixels above the threshold level -sparse-color method args fill in a image based on a few color points -splice geometry splice the background color into the image -spread radius displace image pixels by a random amount -statistic type geometry replace each pixel with corresponding statistic from the neighborhood -strip strip image of all profiles and comments -swirl degrees swirl image pixels about the center -threshold value threshold the image -thumbnail geometry create a thumbnail of the image -tile filename tile image when filling a graphic primitive -tint value tint the image with the fill color -transform affine transform image -transparent color make this color transparent within the image -transpose flip image vertically and rotate 90 degrees -transverse flop image horizontally and rotate 270 degrees -trim trim image edges -type type image type -unique-colors discard all but one of any pixel color -unsharp geometry sharpen the image -vignette geometry soften the edges of the image in vignette style -wave geometry alter an image along a sine wave -white-threshold value force all pixels above the threshold into white Image Sequence Operators: -append append an image sequence -clut apply a color lookup table to the image -coalesce merge a sequence of images -combine combine a sequence of images -composite composite image -crop geometry cut out a rectangular region of the image -deconstruct break down an image sequence into constituent parts -evaluate-sequence operator evaluate an arithmetic, relational, or logical expression -flatten flatten a sequence of images -fx expression apply mathematical expression to an image channel(s) -hald-clut apply a Hald color lookup table to the image -morph value morph an image sequence -mosaic create a mosaic from an image sequence -print string interpret string and print to console -process arguments process the image with a custom image filter -separate separate an image channel into a grayscale image -smush geometry smush an image sequence together -write filename write images to this file Image Stack Operators: -clone indexes clone an image -delete indexes delete the image from the image sequence -duplicate count,indexes duplicate an image one or more times -insert index insert last image into the image sequence -reverse reverse image sequence -swap indexes swap two images in the image sequence Miscellaneous Options: -debug events display copious debugging information -help print program options -list type print a list of supported option arguments -log format format of debugging information -version print version information By default, the image format of `file' is determined by its magic number. To specify a particular image format, precede the filename with an image format name and a colon (i.e. ps:image) or specify the image type as the filename suffix (i.e. image.ps). Specify 'file' as '-' for standard input or output.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值