5 min read
我又做个AI插件,这次是在Blender中合成3D场景效果图的

前言
我最近都一直思考如何让AI工具,融入到设计师的工作流中,对于电商出图,尤其是大量的场景图,应该来说是最耗费时间和精力的,主要在于花很多时间去搭建场景。 之前我也探索了,使用ComfyUI进行合成,感兴趣可以回去看看:# 【AI辅助设计】AI生成HDR贴图 不久前,我还使用Blender加Midjourney的方式,尝试用3D的形式合成。也可以看看:【AI辅助设计】电商设计师看看?AI+Blender 打造真实场景渲染图
纯ComfyUI方式合成,其实有很大局限性,主要在于光影不能完全可控,需要不断抽卡,做小图还行,出不了大图。
Blender的3D模式,可以解决这个问题,前提是有3D模型和需要一定的设置,而且跟AI的流程是割裂的。
所以,我做了这个插件。 主要解决的是,可以通过AI生成背景图(当然也可以上传),在经过一定的程序化处理,让3D模型融入到背景中,这样可以大大提升渲染的效率。
视频版介绍=
插件功能
通过AI生成背景图
我使用的Replicate
的API,调用flux-1.1-pro
模型进行背景图生成。
通过输入提示语加特定摄影风格的方式,拼接到提示语传入到大模型中。
flux-1.1-pro
模型的出图质量还是很高的,跟Midjourney不相上下了 👏。
我们随便看几张出图效果~
A grey helmet resetting on a dark snow piece of ground, with snow capped mountains in the distance in the background, a dark scene in space, in the style of futuristic spacescapes, thin steel forms, chalk, atmospheric skies, minimalist surrealism, photo take with provia, grey academy
Beige pastel background with a smooth square base in the center and no product on top. Soft beige clouds gather around the bottom of the image, creating a dreamy and whimsical atmosphere. The lighting is soft and diffuse, emphasizing the glossy texture of the base while maintaining an ethereal, muted color scheme.
A close-up shot of the wooden coffee table with a grey linen place mat on it, in front of a white sofa and shelves with books and plants. The focus is on the detailed texture of the wood grain and fabric, set against soft natural light creating gentle shadows. A blurred background reveals an open space filled with greenery and sunlight streaming through large windows. This composition creates a serene atmosphere perfect for home decor photography, highlighting both wood and fabric textures in the style of minimalist interior photography.
作为渲染背景是完全没问题的。
背景图生成环境贴图
要使3D模型融入环境中,那么最直接的方法就是让背景和环境HDR贴图要一致,这样3D的光线关系才能融入。 所以插件有一个自动化处理程序,可以将背景图处理为环境贴图。 当然,这只是一种模拟方法,作为照明,也可以了 🥱。
由左图通过python运行得出右图。
自动匹配背景图透视
可以根据背景图的透视灭点,修改当前摄像机的焦距,从而达到了匹配透视的效果。
高光位置检测
检测环境图的高光位置,并安置一盏太阳光,这样就可以模拟环境投射出来的阴影了。
自动设置合成
包括以下合成:
- 摄像机背景,用于作为背景图使用
- 合成。处理3D和背景图作为最终输出。
使用方法
- 下载插件。目前还在测试中,如果感兴趣的朋友可以给我留言,我会加快进度
- 需要使用Replicate的API,每个人都可以注册。
- 将Replicate API token填入插件中
- 开始使用!
局限性
这个插件本质还是通过自动化方式把环境设定好,如果需要调整更细的光照,还是需要手动打光的。
更多 AI 辅助设计和设计灵感趋势,请关注公众号(设计小站):sjxz00。