将ChatGPT变成Midjourney提示生成器

news/2024/7/11 6:49:17 标签: chatgpt, midjourney, 人工智能, 深度学习

已经有人总结过可以让ChatGPT作为Midjourney图像生成的模板。在本文中,我们将展示如何根据个人用例创建这些提示,这可以让ChatGPT生成的提示可控性更高。

选择提示模板

Midjourney的模板结构性很强,所以我们这里使用一下的结构:

让ChatGPT为我们工作

为了让ChatGPT工作,我们还要创建ChatGPT的提示,这样才能让它帮我们生成Midjourney的提示。

ChatGPT的提示的作用是让ChatGPT迭代我们的想法并创建与之相关的图像提示。我们只对ChatGPT提出我们的想法和要求,让ChatGPT为我们工作。

一个可靠而有效的ChatGPT提示符有两个主要成分:指令和上下文

首先我们从上下文开始:我们可以简单地将我们的要求变为前缀、场景和后缀:

 #这是Midjourney的命令
 
 /imagine prompt: PREFIX, SCENE, SUFFIX
 
 PREFIX defines the image's medium and style
 SCENE defines the content
 SUFFIX modulates PREFIX and SCENE

在下一步中,就是要将我们将上下文与ChatGPT如何处理信息的指令结合起来:

 This is the basic prompt anatomy for image generation with Midjourney:
 
 /imagine prompt: PREFIX, SCENE, SUFFIX
 
 PREFIX defines the image's medium and style
 SCENE defines the content
 SUFFIX modulates PREFIX and SCENE
 
 Create 10 prompts that illustrate the theme "father-son relationship"

上面和下面的限定就是我们对ChatGPT的要求,ChatGPT会根据我们的要求来返回结果,大概是这样的:

 1. /imagine prompt: Vintage sepia photograph, A father teaching his son how to ride a bicycle in a park, With a sense of warmth and nostalgia.
 
 2. /imagine prompt: Renaissance oil painting, A king passing his crown to his son in a lavish throne room, With an atmosphere of grandeur and responsibility.
 
 3. /imagine prompt: Animated family movie style, A dad and son building a rocket ship in their backyard, Infused with a sense of adventure and bonding.
 
 4. /imagine prompt: Watercolor sketch, A father and son fishing on a quiet lake as the sun sets, With a serene and tranquil atmosphere.
 
 5. /imagine prompt: Comic book art, A superhero father with his sidekick son saving the day, With dynamic action and a sense of camaraderie.
 
 6. /imagine prompt: Traditional Japanese Ukiyo-e style, A samurai father and his young son practicing martial arts under a cherry blossom tree, With a sense of discipline and tradition.
 
 7. /imagine prompt: 90s sitcom illustration, A dad and son laughing together while attempting to fix a car in a garage, With a vibe of humor and togetherness.
 
 8. /imagine prompt: Modern abstract art, An interpretation of the emotional bond between a father and son, With swirling colors that convey deep connection and love.
 
 9. /imagine prompt: Children’s book illustration, A boy on his father’s shoulders, looking up at the stars, With a sense of wonder and shared curiosity.
 
 10. /imagine prompt: Sci-fi concept art, A father and son in futuristic gear exploring an alien planet, With a sense of discovery and shared adventure.

我们可以简单地复制/粘贴这些提示到Midjourney。以下是其中的一些结果:

以上就是最简单ChatGPT的使用技巧,下面我们还可以进行更高级的应用

扩充思路

因为ChatGPT使用了大量的语料库进行训练,所以我们可以让它帮我我们扩充思路,例如下面的提示:

 keep theme, set prefix to "modern abstract art", 
 scene should contain metaphors (without explanations), 
 use suffix to implement lens and camera types. list 5 prompts

结果如下:

 /imagine prompt: Modern abstract art, An anchor and a soaring kite entwined, With a fisheye lens capturing the circular interplay of stability and freedom.
 
 /imagine prompt: Modern abstract art, A torch casting shadows of successive taller figures, With a tilt-shift lens emphasizing the central flame as the source of growth.
 
 /imagine prompt: Modern abstract art, Rivers of color weaving from a storm to a calm sea, With a wide-angle lens to envelop the viewer in the journey.
 
 /imagine prompt: Modern abstract art, A lighthouse beam morphing into a tapestry of music notes, With a telephoto lens bringing focus to the distant harmony.
 
 /imagine prompt: Modern abstract art, Clock gears turning into an unfolding map, With a macro lens capturing the intricacies of time and adventure's intertwinement.

结果如下:

优化ChatGPT输出

Midjourney有一个叫permutation 的功能,我们在以前的文章中也做过介绍,所以可以使用下面方法,让ChatGPT生成相应格式的结果:

 This is the basic prompt anatomy for image generation with Midjourney:
 
 /imagine prompt: PREFIX, SCENE, SUFFIX
 
 PREFIX defines the image's medium and style
 SCENE defines the content
 SUFFIX modulates PREFIX and SCENE
 
 You can group variations in comma-separated lists like this:
 
 {PREFIX 1, PREFIX 2, PREFIX 3} or {SCENE 1, SCENE 2} or {SUFFIX 1, SUFFIX 2}
 
 Important: when using variations, each item in the list has to be a single word or a phrase without comma (otherwise we'd break the syntax)
 
 ###
 
 Create a prompt that illustrate the theme "father-son relationship". 
 Use 2 variations for prefix and 3 variations for suffix

这样ChatGPT就会返回下面的结果:

 /imagine prompt: {oil painting, watercolor}, a father teaching his son how to 
 ride a bike in a park, {with a touch of nostalgia, under a warm sunset, 
 captured in a moment of laughter}

这样,在将这个提示复制到Midjourney时,会得到一下的结果:

也就是说,可以直接生成6张图片,以下是结果示例:

总结

ChatGPT是通过大量语料库进行训练的大语言模型,而Midjourney则可以生成高质量的图像,通过结合2者的优势实现更加综合和丰富的内容创作。这种综合的内容生成方式能够通过文字和图像同时获得更多的信息和灵感。

https://avoid.overfit.cn/post/60d45f154b7943258f86f8bc7150e79b

作者:Tristan Wolff


http://www.niftyadmin.cn/n/1005768.html

相关文章

ChatGPT:给教育创新带来风险与挑战

在教育界,当前对ChatGPT的关注固然有一部分原因是它所能带来的教育创新,但更多的原因是ChatGPT同时也在冲击着教师的角色定位,推动着人才培养目标的转型,逼迫着学生和教师走出舒适区。况且,ChatGPT还不断诱发教育中的技…

MySQL——mha高可用

MHA的概念 什么是 MHA MHA(MasterHigh Availability)是一套优秀的MySQL高可用环境下故障切换和主从复制的软件。 MHA 的出现就是解决MySQL 单点的问题。 MySQL故障切换过程中,MHA能做到0-30秒内自动完成故障切换操作。 MHA能在故障切换的过…

利用ChatGPT提升编程能力:人工智能助力编程学习之路

利用ChatGPT提升编程能力:人工智能助力编程学习之路 在本文中,我们将探讨如何利用ChatGPT提升编程能力。作为一种人工智能(AI)技术,ChatGPT可以为程序员在编程学习过程中提供极大的帮助。在本文中,我们将详…

5.7.3 UDP协议格式(二)使用Wireshark分析UDP用户数据报

5.7.3 UDP协议格式(二)使用Wireshark分析UDP用户数据报 我们通过对Wireshark采集的UDP用户数据报进行分析,判定一下UDP用户数据报报文接收的是否正确,这里我们首先要对Wireshark采集到的UDP数据的含义。 如图 其中分组详情面板中…

Tomcat的优化及多实例部署

文章目录 一.Tomcat的优化1.tomcat启动速度优化——random2.Tomcat配置文件参数优化2.1 常用的优化相关参数2.2 优化的配置文件 二.Tomcat多实例部署1.为什么会有tomcat多实例部署2.多实例部署图示3.多实例部署的配置3.1 安装JDK3.2 安装启动Tomcat3.3 配置 tomcat 环境变量3.4…

C语言程序生命周期

可能大家都知道一个C语言程序需要经过编译生成可执行文件就可以运行起来,但是这并非是一个完整的C语言程序流程,下面我们就详细了解一下C语言程序的整个生命周期。 一个完整C语言的生命周期分为以下五个部分: 编写代码编译链接装载执行 1. 编写代码 编写代码是大…

【C语言初阶(6)】猜数字游戏

文章目录 1. 游戏描述2. 代码结构2.1 菜单函数2.2 游戏函数2.3 主体函数 3. 代码实现 1. 游戏描述 电脑自动生成一个1-100以内的数字。我们输入一个我们猜的数字。如果我们猜的数字比电脑随机生成的数字大,那么输出(猜大了),反之…

【Django】如何在django模型中添加一个*后面的必填字段

form.py 会被单独访问的字段(如使用{{form.as_p}}),然后可以将属性添加到您的ModelForm required_css_class = ‘required’ class MyForm(forms.Form):required_css_class = required这将定义的所有领域需要为具有“必要”类 然后你就可以使用CSS添加星号: test.html …