返回顶部
热门问答 更多热门问答
技术文章 更多技术文章

Ollama Flux模型会擦出怎样的火花

[复制链接]
链载Ai 显示全部楼层 发表于 昨天 11:09 |阅读模式 打印 上一主题 下一主题

Hello,大家好。最近,随着Flux模型的开源,越来越多的小伙伴加入了AI画图行列,都立志成为下一位“梵高”。不过呢,很多小伙伴在创作的途径中会灵感枯竭,摆着以往,一般都会上一些素材网站看看别人的作品,对吧!?可是,现在是2024年了,当你没了灵感肯定找人工智能呀。

那么,今天就来分享一下如何不借助大厂的AI,用开源的大语言模型(LLM)来制作一个随时给你灵感的AI机器人。

Ollama启动


要用本地部署的开源大语言模型没有Ollama框架怎么能行呢,首先你得先安装它,安装教程就不在这里赘述了,请看以往的文章。

基于Ollama本地部署Llama3指南!

然后windows用powershell输入命令行:

ollamarungemma2:27b

至于其他模型能不能用,我不是很确定,至少gemma2对于systemprompt的理解能力还是非常棒的。ingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;font-size: var(--articleFontsize);letter-spacing: 0.034em;"/>

等到模型拉取完毕,我们开始用ollama的modelfile功能创建一个新的模型。在一个文件夹内新建一个文件,*.txt格式就行,参数和system prompt设置如上图,当然啦,还有更多参数可以设置,这里就不一一解释了,同样的,可以查看过去文章。

文档内的参数和提示词设置完成后,保存文档,文档名为:modelfile.txt。

我们在modelfile的文件夹下打开powershell,输入命令:

ollamacreateSDArt-fmodelfile.txt

#注释:SDArt 是新建模型的名称,可以换;modelfile.txt是文档名称和格式,可以换。

命令行里显示success就说明成功了,这样创建模型并不会占用你的硬盘空间。

接下去,我们可以打开第三方应用测试一下。那么,我就用我自己正在开发阶段的一款ollama专用的应用。虽然UI比较丑,还没来得及设计,不过对话功能可以用用了。

从对话中可以看出,对于提示词的理解还是不错的,那么我们就用Flux加上这组提示生成一张海报。

PositivePrompt:textAnunderwaterscenewithdimlightingfilteringthroughthesurface,anancientshipwreckpartiallyburiedinsandovergrownwithseaweedandcoral,amysteriousstonestructurenearbywithintricatecarvingserodedbytime,vibrantcoralreefsteemingwithcolorfulfish,starfish,seaurchins,andshellsscatteredontheseabed,alargegrouperhidingintheshadowofthewreck,jellyfishdriftinggracefullyinthecurrent,masterpiece,bestquality,4k,illustrationstyle,atmosphericlighting,detailedtextures.


Positive Prompttext A solitary Batman overlooking Gotham City from the night sky, in his iconic Batsuit, standing against a backdrop of the city's dark and Gothic architecture illuminated by the night lights, capturing the brooding atmosphere of Gotham City, masterpiece, high quality, detailed character, dramatic cityscape, atmospheric lighting, starry night sky, 4k resolution, illustration style, depth of field, superhero theme, expressive facial features, detailed Batsuit, iconic Gotham buildings, city lights, night ambiance, Batman's flying vehicle or grappling hook in use.




回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

链载AI是专业的生成式人工智能教程平台。提供Stable Diffusion、Midjourney AI绘画教程,Suno AI音乐生成指南,以及Runway、Pika等AI视频制作与动画生成实战案例。从提示词编写到参数调整,手把手助您从入门到精通。
  • 官方手机版

  • 微信公众号

  • 商务合作

  • Powered by Discuz! X3.5 | Copyright © 2025-2025. | 链载Ai
  • 桂ICP备2024021734号 | 营业执照 | |广西笔趣文化传媒有限公司|| QQ