Fabric create_logo 模式实战:把品牌描述变成极简无字 Logo 图像提示词
2026/9/9 12:26:45 网站建设 项目流程

Fabric create_logo 模式实战:把品牌描述变成极简无字 Logo 图像提示词

【免费下载链接】FabricFabric is an open-source framework for augmenting humans using AI. It provides a modular system for solving specific problems using a crowdsourced set of AI prompts that can be used anywhere.项目地址: https://gitcode.com/GitHub_Trending/fa/Fabric

Fabric 内置的create_logo模式(Pattern)是一个专用于 Logo 创意生成的提示词模板:它把用户输入的公司/品牌描述,转换成一条适合直接投递给 AI 图像生成器的"极简、无文字、矢量风格"Logo 提示词。阅读本文后,你将掌握该模式的完整设计意图、逐条指令语义,并能在 Fabric CLI / 配置文件中直接复用它,为你的品牌或产品快速产出干净有力的视觉符号。

一、create_logo 模式是什么

在 Fabric 中,"Pattern"是一套可复用的 AI 指令文件,存放在 data/patterns 目录下,每个子目录对应一个独立能力。create_logo属于其中的设计/创作类模式,其核心定义位于 data/patterns/create_logo/system.md。

这个模式定位非常聚焦:只做一件事——基于输入内容生成一条"简单、优雅、有冲击力"的无文字极简 Logo 图像描述。它并不直接画 Logo,而是产出可供图像生成模型执行的图像描述文本,是"提示词生成器"而非"画布"。

在 data/patterns/pattern_explanations.md 中,官方对它的概括是:"Creates simple, minimalist company logos without text, generating AI prompts for vector graphic logos based on input."(基于输入生成矢量图形 Logo 的 AI 提示词,产出不带文字的极简公司 Logo。)

二、逐条拆解 system.md:模式指令语义

create_logo/system.md全文结构紧凑,分为四段,下面逐节还原并解释其约束含义。

1. IDENTITY and PURPOSE(身份与目标)

原文核心要求:

You create simple, elegant, and impactful company logos based on the input given to you. The logos are super minimalist and without text.

Take a deep breath and think step by step about how to best accomplish this goal using the following steps.

解读:

  • 身份设定:模型被赋予"Logo 设计师"角色,输入来源不限,但产物必须服务于"公司 Logo"这一用途。
  • 美学基调simple(简单)、elegant(优雅)、impactful(有冲击力)、super minimalist(超级极简)。
  • 硬性红线without text——Logo 中不得出现任何文字(这也隐含了不必依赖文字说明的图形化表达要求)。
  • "Take a deep breath and think step by step"是要求模型在生成前进行推理,把思路收敛后再产出描述。

2. OUTPUT SECTIONS(输出区段)

原文核心要求:

Output a prompt that can be sent to an AI image generator for a simple and elegant logo that captures and incorporates the meaning of the input sent. The prompt should take the input and create a simple, vector graphic logo description for the AI to generate.

解读:输出形态不是"设计说明",而是一条可直接发送给 AI 图像生成器的提示词。它应当从输入中抽取并内化(captures and incorporates)输入的含义,最终产出一条"简单、矢量图形风格"的 Logo 描述。

3. OUTPUT INSTRUCTIONS(输出纪律)

原文四条硬性纪律,构成模式的核心约束:

约束含义与目的
Ensure the description asks for a simple, vector graphic logo描述中必须显式要求"矢量图形",保证可缩放、可商用落地
Do not output anything other than the raw image description输出只能是"裸提示词",不夹带解释、前言或建议
You only output human-readable Markdown使用人类可读的 Markdown(而非 JSON 等机器格式)
Do not output warnings or notes不输出警告或备注,杜绝干扰图像生成器的冗余信息

4. INPUT(输入占位)

原文以INPUT:结尾,随后由 Fabric 运行时把用户实际输入追加到该位置(详见下文第三部分)。

完整原文

为保证事实准确、便于你作为定制模板二次开发,system.md原文如下(文件路径 data/patterns/create_logo/system.md):

# IDENTITY and PURPOSE You create simple, elegant, and impactful company logos based on the input given to you. The logos are super minimalist and without text. Take a deep breath and think step by step about how to best accomplish this goal using the following steps. # OUTPUT SECTIONS - Output a prompt that can be sent to an AI image generator for a simple and elegant logo that captures and incorporates the meaning of the input sent. The prompt should take the input and create a simple, vector graphic logo description for the AI to generate. # OUTPUT INSTRUCTIONS - Ensure the description asks for a simple, vector graphic logo. - Do not output anything other than the raw image description that will be sent to the image generator. - You only output human-readable Markdown. - Do not output warnings or notes —- just the requested sections. # INPUT: INPUT:

三、运行机制:system.md 如何被 Fabric 加载并注入输入

理解 Fabric 内部如何"跑"这份 system.md,能帮你预判实际使用效果。相关实现集中在 internal/plugins/db/fsdb/patterns.go。

  1. 模式即目录 + 固定文件名:在数据层初始化时,Pattern 存储被定义为"目录即模式、目录内system.md即提示词主体",见 internal/plugins/db/fsdb/db.go。因此create_logo的加载路径就是patterns/create_logo/system.md
  2. 名称或文件路径二选一:internal/plugins/db/fsdb/patterns.go 的loadPattern会先判断参数是否形如文件路径(以/~.等开头);不是路径就按"模式库名称"从 DB 目录读取。所以既可以用--pattern create_logo,也可以指向任意*.md文件(如--pattern /path/to/logo.md)。
  3. 输入自动注入{{input}}system.md本身以INPUT:结尾、正文不含占位符时,Fabric 的ensureInput会检测是否存在{{input}},若不存在则在文件末尾补\n{{input}},随后applyInput用真实输入替换该占位符(见 internal/plugins/db/fsdb/patterns.go)。这正是"INPUT:"之后能自然接上你的品牌描述的原因。
  4. 变量替换(可选)applyVariables在替换{{input}}前后会对形如{{var}}的模板变量做递归解析(见 internal/plugins/db/fsdb/patterns.go)。create_logo官方版本没有声明额外变量,你只需提供{{input}}即可;若要定制模板,可自行改造。
  5. HTTP 防护:源码中还实现了LooksLikePatternFilePath校验与符号链接安全检查(见 internal/plugins/db/fsdb/patterns.go),确保经 REST 接口使用模式时不会被当作任意文件读取——这属于路径安全设计,不影响日常 CLI 调用。

值得一提:模式目录中的 data/patterns/create_logo/user.md 目前为空文件;Fabric 的 fsdb 数据层以system.md为唯一主体,因此空 user.md 不影响加载与运行。若你参考 official_pattern_template 的写法,可在 user.md 中补充模式面向的使用场景说明,便于模式库检索与浏览。

四、三种实战运行方式

Fabric 支持--pattern(短参数-p)指定模式,定义见 internal/cli/flags.go。运行create_logo的常见方式如下。

方式一:命令行参数直传

fabric --pattern create_logo "A mountain guide company named Summit, trustworthy and adventurous"
  • 双引号内的文本会作为{{input}}注入;
  • 模型读完整份 system.md + 输入后,只返回一条"可直接交给图像生成器"的 Logo 描述;
  • 想省去引导提示语时,也可直接传一句更口语化的描述,例如"An eco-friendly coffee roastery using solar power"

方式二:管道(stdin)输入

cat brand_brief.txt | fabric --pattern create_logo echo "A friendly cybersecurity consultancy protecting small business" | fabric --pattern create_logo

CLI 会把管道内容作为消息与模式一并提交,适合批量处理多组品牌描述(例如一次为 5 个候选品牌各生成一个方向)。

方式三:config.yaml 固化默认模式

Fabric 支持把常用参数写进 YAML 配置,官方示例见 internal/cli/example.yaml。可在~/.config/fabric/config.yaml中预设:

pattern: create_logo model: gpt-4o

此后即使不带任何参数,CLI 也会默认走create_logo;命令行显式传参仍可覆盖。源码在解析时会先读 CLI flags,再以配置文件补齐未使用的字段(见 internal/cli/flags.go),因此参数优先级为"命令行 > 配置文件"。

进阶技巧:把模式变成一条命令

源码中有一个便利设计:若可执行文件(或 symlink/alias)名既不是fabric也不是main/cmd,程序会把该名字当作--pattern值(见 internal/cli/flags.go)。因此你可以直接建立别名,像使用独立命令一样调用:

alias create_logo='fabric --pattern create_logo' create_logo "A cat café brand that is cozy and playful"

Docker 环境下的等价用法(数据目录挂载到~/.fabric-config,参见仓库根目录 README.md):

docker run --rm -it -v $HOME/.fabric-config:/home/appuser/.config/fabric kayvan/fabric:latest -p create_logo "你的品牌描述"

调试时可先用以下命令查看模式原始内容、确认模式已被收录:

fabric --listpatterns | grep create_logo fabric --readpattern create_logo

对应的能力实现见 internal/cli/flags.go,输出逻辑在 internal/plugins/db/fsdb/patterns.go。

五、把"Logo 提示词"真正用起来:输入与产物衔接建议

create_logo的产出是一条图像描述文本,不是图片本身。因此完整工作流是两段式:先用 Fabric 得到描述,再把它粘贴进任意外部 AI 图像生成工具执行。

  • 输入侧建议:为了让输出更贴合品牌,尽量给足"行业 + 名称或符号语义 + 气质形容词"三要素。例如:
    • A logistics company specializing in cold-chain delivery(行业)
    • geometric iceberg as the core symbol(图形语义)
    • minimal, reliable, forward-moving(气质)
  • 产物侧预期:得到的应当是满足 system.md 纪律的一段纯描述——它显式包含"vector graphic / minimal / no text"等关键词,不含任何多余解释或格式包裹,可直接作为图像生成参数。

关于"如何挑选、迭代生成结果",系统提示词设计上刻意把决策权留给你:你可以基于第一条输出微调输入文本反复运行,也可以把多轮输出分别送去生成后对比。这与同一模式库中其他创作类模式(如 create_art_prompt 生成详细视觉描述)形成互补:前者追求描述的艺术张力,create_logo则严格收敛为极简无字、可落地的矢量 Logo 方向。

六、注意事项与边界

  • 输出只服务于图像生成器:不要把模型的回复当成"设计说明"或"提案文档",它是逐字用于生图的提示词,保留原样使用效果最佳。
  • 文字禁令不要自行放宽without text是质量红线;若你的品牌强烈依赖文字 Logo,建议另行评估而非修改本模式——那会改变其设计目标。
  • 不同图像生成模型对提示词的执行差异:Fabric 只负责生成描述文本,实际生成质量取决于你选择的图像生成模型对"vector graphic、no text、minimalist"等关键词的遵循程度。你可以按需在上游输入中补充风格锚点(扁平、几何、单色等),但不要破坏"输出保持为纯净提示词"的纪律。
  • 输入中不要携带噪音:system.md 对输出有严格净化要求,输入侧也尽量只放品牌相关内容,避免大段无关文本稀释含义提取质量。

七、延伸阅读

  • 模式源文件:data/patterns/create_logo/system.md、目录说明文件 data/patterns/create_logo/user.md
  • 模式运行原理:internal/plugins/db/fsdb/patterns.go、internal/plugins/db/fsdb/db.go
  • CLI 参数与配置:internal/cli/flags.go、internal/cli/example.yaml
  • 模式目录总索引:data/patterns/pattern_explanations.md
  • 自定义新模式的官方模板:official_pattern_template

【免费下载链接】FabricFabric is an open-source framework for augmenting humans using AI. It provides a modular system for solving specific problems using a crowdsourced set of AI prompts that can be used anywhere.项目地址: https://gitcode.com/GitHub_Trending/fa/Fabric

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询