最强“辅助”!巧用Llama3生成SD提示词,让绘画变得更简单

AI教程 2024-05-09

Llama3简介

Llama 3是由Meta公司推出的一款大型语言模型(LLM),其版本规模从8B到400B参数不等,这超越了包括谷歌的Gemma/Gemini、Mistral和Claude 3 Sonnet在内的众多竞争对手,且能在仅4GB的GPU上实现高效运行,为商业应用提供了更多可能性。

HuggingFace上有大神发布了基于Llama3的stable diffusion的prompt提示词微调模型——llama3_ifai_sd_prompt_mkr_q4km。我们可以向模型输入简单的提示,Llama3将会给我们返回详细的提示描述。

image.png

Llama3部署

llama3_ifai_sd_prompt_mkr_q4km模型已上架Ollama仓库。

1715224261471.png

执行ollama run impactframes/llama3_ifai_sd_prompt_mkr_q4km即可完成部署。

image.png

测试使用

以往我们在使用Stable Diffusion时,自己思考提示词是一件很消耗脑细胞的事情。通过大模型生成的提示词往往更加精准、丰富多样,能够引导Stable Diffusion产出更高分辨率、细节更丰富的图像。大型语言模型能够理解和生成高度复杂、抽象的概念描述,这为图像生成提供了无限的创意空间。用户可以使用自然语言描述极其详细或新颖的场景,即使是那些现实中不存在或难以想象的构想,大模型都能辅助生成精确的提示词,进而创造出独特且富有创意的图像作品。并且对于非专业设计人员来说,直接操作复杂的图像生成参数可能较为困难。而利用大模型生成的提示词作为桥梁,用户只需简单描述心中所想,即可得到满意的作品,极大地降低了艺术创作和技术使用的门槛。

提示词1:一个人站在山顶

>>> A man standing atop of a mountain

Philosophical, introspective, contemplative, solitary figure, dressed in simple attire, standing at the summit of

a majestic mountain, gazing out at the breathtaking panorama, lost in thought, pondering the mysteries of

existence, the universe, and human nature, as the wind whispers secrets in his ear, the sun

image.png

提示词2:拟人的猫猫坐在电脑前工作

>>> 拟人的猫猫坐在电脑前工作

Fictional character, anthropomorphic cat named 'Whiskers', sitting comfortably at a desk in front of a computer

screen, wearing glasses, typing away with paws, intense focus on the task at hand, surrounded by scattered papers,

pencils, and catnip toys, whimsical atmosphere, soft lighting, cozy setting.

image.png

提示词3:即将降落月球的宇宙飞船

>>> 即将降落月球的宇宙飞船

Soaring through space, the sleek, silver spacecraft, 'Lunar Quest', prepares to land on the moon's surface, vast

craters and rugged terrain visible beneath, solar panels extended, engines firing, smoke trails forming,

astronauts in suits, suited up for lunar exploration, lunar module separating from main spacecraft, majestic Earth

rising above horizon, dramatic sky gradient.

image.png

提示词4:机器人战争

>>> 机器人战争

Advanced, mechanized armies clashing on a desolate battlefield, steel behemoths with glowing blue eyes, towering

robots marching across the terrain, smoke and flames engulfing the landscape, laser beams slicing through the air,

explosions rocking the ground, metal shards flying everywhere, apocalyptic devastation, twisted ruins in the

distance.

image.png

提示词5:现代化的熊猫战士

>>> 现代化的熊猫战士

Panda warrior, dressed in futuristic armor, helmet adorned with panda emblem, standing confidently on a futuristic

battlefield, holding energy sword, shield emblazoned with panda pattern, advanced jetpack strapped to back,

airbrushed camouflage design, bold lines, metallic sheen, modern technology merged with ancient symbolism.

image.png

插件

如果感觉每次手动复制比较麻烦,可以在SableDiffusion下载IF_prompt_MKR插件。

image.png

插件安装好,重启SableDiffusion遇到报错:

image.png

我们需要在这块安装openai框架:

image.png

安装好openai框架后,再次启动SableDiffusion就不会报错了。这时候,我们打开Web页面,在设置—>未分类里找到iF_prompt_MKR,设置Ollama。

image.png

设置完成后,在文生图页面的脚本处设置:


image.png

此外,我们还可以根据自己的需要设置系统提示词和反向提示词。

image.png

所有设置完毕后,在Input Prompt处输入自己想要绘画的概要内容,点击生成即可。

本文来源于网络,版权归原作者所有!

@版权声明:部分内容从网络收集整理,如有侵权,请联系删除!

相关文章