Stable Diffusion 商业应用:服装换模特

2023-08-0917:54:35办公软件与工具应用Comments2,092 views字数 2683阅读模式

服装换模特,就是把衣服穿在模特道具上,然后拍摄成照片,通过SD处理,将模特道具替换成真人模特。这时候就有人会问,还能这样搞啊,是的,现在电商平台上已经开始通过这种方式做主图详情,不用花钱请真模特拍摄,生了一大笔运营费用。下面我们来看一下这个是怎么做的吧~文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

1.拍摄产品的模特道具上身照片,文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

要求光线对比合适,图片质感更好。背景干净,最好纯色或灰色,那样服饰颜色与背景反差大,便于AI识别拆分板块,蒙版抠图。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

2.使用Segment Anything(分离图像元素)插件,将图片中的衣服抠出来,作为蒙版,也可以在PS中将它抠出来做成蒙版。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

Stable Diffusion 商业应用:服装换模特文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

操作步骤:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

  1. 设置好图片尺寸为:512x768px,上传图片;
  2. 启用 GroundingDINO;
  3. 选择GroundingDINO 模型(电脑配置好就用938M的);
  4. 填入GroundingDINO 检测提示词:clothing;
  5. 想预览的话可以勾选:我想预览 GroundingDINO 的结果并选择我想要的箱体。
  6. 点击按钮:Generate bounding box;

     文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

    Stable Diffusion 商业应用:服装换模特

  7. 选择效果比较好的图,下载下来,或者选择喜欢蒙版的序号1(选择代表第二个),然后勾选:copy to inpaint upload选项,最后点击按钮:发送到 重绘蒙版。

3.ControlNet图片处理,与下一步的openpose骨架图结合,控制要生成模特的姿势动作。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

标签ControlNet Unit 0:选择控制模型:局部重绘,预处理器选择:inpaint_global_harmonious.文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

Stable Diffusion 商业应用:服装换模特文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

标签ControlNet Unit 1:上传刚刚抠出来的衣服图片,选择控制模型:canny(硬边缘),点击爆炸图标,这样衣服的图片就以线条的形式勾勒出来了。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

Stable Diffusion 商业应用:服装换模特文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

 文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

如果我们展示的是中长袖服饰,模特姿势是基本固定的,那么我们可以用canny直接生成线稿生成即可,不需要Openpose识别。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

Stable Diffusion 商业应用:服装换模特文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

 文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

如果是完整模特模型人台或者真人,就算衣服(短裤,短裙等)遮挡不多,我们也可以直接用Openpose识别,自动生成骨架图,然后进行重绘。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

Stable Diffusion 商业应用:服装换模特文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

 文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

我们这次用的是非完整的模特道具,衣服遮挡少,模特的姿势发挥空间不固定,需要配合3D Openpose识别,生成骨架图重绘。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

Stable Diffusion 商业应用:服装换模特文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

4.打开3D Openpose插件。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

a.先根据抠出来的衣服图片在右侧标签栏设置好宽高尺寸(512x768px)。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

b.女模特骨骼偏小,设置骨骼厚度为0.5。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

c.对骨架做一个简单的调整,然后生成。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

Stable Diffusion 商业应用:服装换模特文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

d.选择需要的骨架,设置Control model number数值为2(即发送到:标签ControlNet Unit 2中),其余不要的都选择横杠-,点击按钮:发送到图生图。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

Stable Diffusion 商业应用:服装换模特文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

e.来到标签ControlNet Unit 2,点击启用+完美像素模式+OpenPose(姿态)+预处理为none,然后为了避免AI生成的模特姿势比较扭曲不自然,可以设置终止实际为0.8,剩下0.2让AI自由发挥。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

5.设置局部重绘窗口参数。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

  • 蒙版模式:重绘非蒙版内容。
  • 蒙版内容处理:潜空间噪声
  • 采样方式:DPM++SDE Karras,
  • 打开面部修复,
  • 设置尺寸与图片一致(512x768px),
  • 提示词引导系数(CFG scale)为10,
  • 重绘幅度为0.9,

6.选择脸部和手部修复插件ADetailer。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

启用,选择真人脸部修复模型:face_yolov8s.pt文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

Stable Diffusion 商业应用:服装换模特文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

7.输入提示词Prompt,这里直接用之前预设好的模板。点击生图。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

Prompt文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

(completely nude:1.4),masterpiece,best quality,raw photo,best quality,photorealistic,simple background,ultra high res,(RAW photo),文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

1girl,solo,thin female,(half body:1.2),medium shot,high detail face,smile,white light,(create a polished look:0.3),(white background:1.1),文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

 文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

Negative prompt文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

((nsfw)),sketches,tattoo, (beard:1.3),(EasyNegative),badhandv4, lowres,(worst quality:2),(low quality:2),(normal quality:2),lowers,normal quality,facing away,looking away,text,error,extra digit,fewer digits,cropped,jpeg artifacts,signature,watermark,username,blurry,skin spots,acnes,skin blemishes,bad anatomy,fat,bad feet,cropped,poorly drawn hands,poorly drawn face,mutation,deformed,tilted head.bad anatomy.bad hands,extra fingers,fewer digits.,extra limbs.extra arms,extra legs,malformed limbs.fused fingers.too many fingers,long neck,cross-eyed,mutated hands,bad body,bad proportions,gross proportions,text,error,missing fingers,missing arms,missing legs,extra digit,extra arms,extra leg,extra foot,missing fingers,文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

lora自定义搭配即可。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

Stable Diffusion 商业应用:服装换模特文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

这里补一下:以上文件安装链接:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

>> Segment Anything for Stable Diffusion WebUI :文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

guthub地址:https://github.com/continue-revolution/sd-webui-segment-anything文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

>> Sd-webui-3d-open-pose-editor:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

guthub地址:https://github.com/nonnonstop/sd-webui-3d-open-pose-editor文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

>> Bing-su/adetailer:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

guthub地址:https://github.com/Bing-su/adetailergithub.com/nonnonstop/sd-webui-3d-open-pose-editor文章源自菜鸟学院-https://www.cainiaoxueyuan.com/office/53181.html

  • 本站内容整理自互联网,仅提供信息存储空间服务,以方便学习之用。如对文章、图片、字体等版权有疑问,请在下方留言,管理员看到后,将第一时间进行处理。
  • 转载请务必保留本文链接:https://www.cainiaoxueyuan.com/office/53181.html

Comment

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定