[上一期](https://blog.51cto.com/u_16151971/6421889),我们介绍了Midjourney
基本概念,以及简单给Midjourney Bot
发送了/imagine
指令,这一章我将重点介绍Midjourney Bot
的核心/imagine
指令。
/imagine
怎么玩
玩法其实很简单,我们只需要在Discord
聊天框中键入/imagine
, 然后选中Midjourney Bot
提供的imagine slash command
然后将我们想象的事物用英文
填入prompt
即可。
由此可以看出, 我们想要得到理想的画面
, 我们就需要填入能让Midjourney Bot
能够理解的prompt
。
prompt
怎么填
我们看下官网对prompt的描述:
A Prompt is a short text phrase that the Midjourney Bot interprets to produce an image. The Midjourney Bot breaks down the words and phrases in a prompt into smaller pieces, called tokens, that can be compared to its training data and then used to generate an image. A well-crafted prompt can help make unique and exciting images.
简单翻译下:
prompt
是一个简短的文本短语,Midjourney Bot
解释它以产生一个图像。Midjourney Bot
将提示中的单词和短语分解成更小的片段,称为标记,可以与它的训练数据进行比较,然后用来生成图像。一个精心设计的提示可以帮助制作独特和令人兴奋的图像。
所以我们需要基于我们理想的画面
, 提炼出一些标记
出来,标记
越准确,Midjourney Bot
产生的图像也就越接近我们的需求,后面我会介绍一些常用的标记
,接下来我们看下prompt
有哪些格式。
prompt
格式介绍
接下来我将分别介绍Basic Prompts
、Advanced Prompts
以及 Multi-Prompt
的基本概念。
Basic Prompts
Text Prompt
: 包含对想要场景的描述, 语言尽可能的短小精炼。
Advanced Prompts
Image Prompts
: 包含多个image链接,包含的这些image
会影响最终的风格和内容。
那么如何通过已有的image
获取链接呢? 可以参考如下:
Text Prompt
Advanced Prompts
支持 Multi-Prompt
(多重提示) 和 Permutation Prompts
(交换提示), 大家可以看下官网介绍详细了解下Multi-Prompt。
我简单总结下Multi-Prompt
:
Multi-Prompt Basics
: 在word
后面添加::
, 表明需要midjourney Bot
单独考虑word
和word
,而不是考虑word word
Prompt Weights
: 可以在word::
后面增加一个数字
或小数
代表该效果
的权重, 默认为1
, 值得注意的是,model version
为1,2,3
只支持整数,为4
时才支持小数
。
左图是等权的效果,右图的hot
权重为red
的2倍。
Negative Prompt Weights
负权重, 表示去掉不需要效果
, 值得注意的是: 所有的权重之和必须为正数。
另外--no
参数也可以表示去掉不需要的效果。
例如vibrant tulip fields:: red::-.5
和 vibrant tulip fields --no red
都是一个意思,表示不需要红色
这个色调。
关于Permutation Prompts
的使用后面我会出一个小章节单独介绍下。
parameters
可以参考下官网的介绍, 后面我会单独出一个小章节介绍一下。
Prompting Notes
官网给出了几类建议,我简单总结一下:
Prompt Length
:
Prompts can be very simple. Single words (or even an emoji!) will produce an image. Very short prompts will rely heavily on Midjourney’s default style, so a more descriptive prompt is better for a unique look. However, super-long prompts aren’t always better. Concentrate on the main concepts you want to create.
大致意思: 提示可以很简单,一个单词或表情符号就能产生图像。但过短的提示效果一般,需要更详细的描述;过长的提示也不一定更好,主要关注想要创造的概念即可。
Grammer
:
The Midjourney Bot does not understand grammar, sentence structure, or words like humans. Word choice also matters. More specific synonyms work better in many circumstances. Instead of big, try gigantic, enormous, or immense. Remove words when possible. Fewer words mean each word has a more powerful influence. Use commas, brackets, and hyphens to help organize your thoughts, but know the Midjourney Bot will not reliably interpret them. The Midjourney Bot does not consider capitalization.
大致意思: Midjourney Bot 不理解语法、结构或单词,用更具体的同义词会更好。词越少,词的影响力就越大,可以用标点符号来组织思路,但Midjourney Bot 不会可靠地解释它们,也不考虑大写字母。
Focus on What you Want
It is better to describe what you want instead of what you don’t want. If you ask for a party with “no cake,” your image will probably include a cake. If you want to ensure an object is not in the final image, try advance prompting using the --no.
大致意思: 描述你想要的,而不是你不想要的。如果需要确保图像中没有某个物体,使用"--no"参数进行预先提示。
Think About What Details Matter
Anything left unsaid may suprise you. Be as specific or vague as you want, but anything you leave out will be randomized. Being vague is a great way to get variety, but you may not get the specific details you want.
Try to be clear about any context or details that are important to you. Think about:
- Subject: person, animal, character, location, object, etc.
- Medium: photo, painting, illustration, sculpture, doodle, tapestry, etc.
- Environment: indoors, outdoors, on the moon, in Narnia, underwater, the Emerald City, etc.
- Lighting: soft, ambient, overcast, neon, studio lights, etc
- Color: vibrant, muted, bright, monochromatic, colorful, black and white, pastel, etc.
- Mood: Sedate, calm, raucous, energetic, etc.
- Composition: Portrait, headshot, closeup, birds-eye view, etc.
大致意思:
尽量清晰地表达你所关心的任何背景或细节, 任何你遗漏的细节将被随机化。
Use Collective Nouns
Plural words leave a lot to chance. Try specific numbers. "Three cats" is more specific than "cats." Collective nouns also work, “flock of birds” instead of "birds.”
大致意思: 使用具体数字和集合名词能够减少不必要的随机性。例如,三只猫
比猫
更加明确。同样地,一群鸟
比鸟
更加具体。
另外官方还有一篇Explore Prompting, 感兴趣的可以了解一下。
总结
本章我重点介绍了/imagine
中prompt
相关的概念, 例如Advanced Prompts
, Multi-Prompt
, Prompting Notes
, 这几个我认为是Midjourney
的核心,我们只有认真仔细的理解它们才能够让Midjourney Bot
帮我们画出我们真正需要的画面。
后面几期我会介绍下Midjourney Bot的高级玩法
: 如何使用我开源的 midjourney-go 给Midjourney Bot
发指令,Midjourney Bot
的其他常用指令,midjourney-apiserver
的开发等等一系列文章。