微信扫码
添加专属顾问
我要投稿
微信公众号:AI工程师笔记
关注可了解更多的内容。问题或建议,请公众号留言;
如果你觉得对你有帮助,欢迎赞赏
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将会给我们返回详细的提示描述。
llama3_ifai_sd_prompt_mkr_q4km模型已上架Ollama仓库。
Ollama部署可参考:Windows本机运行7B大模型
执行ollama run impactframes/llama3_ifai_sd_prompt_mkr_q4km
即可完成部署。
C:\Users\Zz>ollama run impactframes/llama3_ifai_sd_prompt_mkr_q4km
pulling manifest
pulling 8c307d788852... 100% ▕████████████████████████████████████████████████████████▏ 4.9 GB
pulling 2190828de961... 100% ▕████████████████████████████████████████████████████████▏ 260 B
pulling 0661d86cbb71... 100% ▕████████████████████████████████████████████████████████▏ 575 B
pulling 563e392d0f49... 100% ▕████████████████████████████████████████████████████████▏ 12 KB
pulling 3ac6276a4a91... 100% ▕████████████████████████████████████████████████████████▏ 415 B
pulling 98f4faea31b4... 100% ▕████████████████████████████████████████████████████████▏ 73 B
pulling d074ab4deb16... 100% ▕████████████████████████████████████████████████████████▏ 633 B
verifying sha256 digest
writing manifest
removing any unused layers
success
以往我们在使用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
提示词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.
提示词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.
提示词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.
提示词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.
如果感觉每次手动复制比较麻烦,可以在SableDiffusion下载IF_prompt_MKR插件。
插件安装好,重启SableDiffusion遇到报错:
我们需要在这块安装openai框架:
安装好openai框架后,再次启动SableDiffusion就不会报错了。这时候,我们打开Web页面,在设置—>未分类里找到iF_prompt_MKR,设置Ollama。
设置完成后,在文生图页面的脚本处设置:
此外,我们还可以根据自己的需要设置系统提示词和反向提示词。
所有设置完毕后,在Input Prompt处输入自己想要绘画的概要内容,点击生成即
可。
关注我,定期分享前沿AI应用。
53AI,企业落地大模型首选服务商
产品:场景落地咨询+大模型应用平台+行业解决方案
承诺:免费场景POC验证,效果验证后签署服务协议。零风险落地应用大模型,已交付160+中大型企业
2025-02-01
2025-01-01
2024-08-13
2025-02-04
2024-04-25
2024-07-25
2024-06-13
2024-09-23
2024-04-26
2024-08-21
2025-03-10
2025-03-10
2025-03-10
2025-03-10
2025-03-10
2025-03-10
2025-03-09
2025-03-08