话不说,先看效果:
视频效果:
提示词:
;;;; 工笔画风格提示词生成器 - Gongbi Style Prompt Generator
;;;; 用于创建适合AI绘图工具的工笔画风格提示词
(defpackage :gongbi-prompt-generator
(:use :cl)
(:export :generate-prompt))
(in-package :gongbi-prompt-generator)
;;; 定义提示词模板结构
(defstruct prompt-template
(base-prompt "A delicate Gongbi-style illustration featuring ~A, who is ~A. The setting is ~A, rendered in fine lines with soft coloring predominantly in ~A. The style combines traditional Gongbi techniques with Neo-Gongbi aesthetics inspired by Song Huizong. The overall atmosphere evokes a feeling of ~A.")
(style "Gongbi-style, Neo-Gongbi, Song Huizong inspired, delicate, detailed, traditional Chinese aesthetics")
(elements '("detailed facial expressions"
"traditional Chinese elements relevant to the scene"
"elegant and precise line work"
"soft gradient coloring"))
(composition "balanced and harmonious layout, central focus on main subject, traditional framing with subtle asymmetry")
(aspect-ratio "3:4 (vertical portrait orientation)")
(additional-notes "Designed to reflect traditional Gongbi aesthetics with modern subtlety, suitable for depicting scenes of quiet introspection and refined beauty."))
;;; 定义用户输入问题
(defvar *input-questions*
'(("subject" . "画面的主题或主要人物是什么? (What is the main subject or character?)")
("activity" . "人物或主题正在做什么? (What is the subject doing?)")
("setting" . "画面的环境或背景是什么? (What is the setting or background?)")
("color-scheme" . "你喜欢的主要色调是什么? (What is your preferred color scheme?)")
("mood" . "希望表达的情绪或氛围是怎样的? (What mood or atmosphere do you want to convey?)")
("special-elements" . "有什么特殊元素想要添加?(可选) (Any special elements to add? (optional))")))
;;; 收集用户输入
(defun collect-user-input ()
"收集用户对每个问题的回答"
(let ((responses (make-hash-table :test 'equal)))
(dolist (question *input-questions* responses)
(format t "~%~A~%" (cdr question))
(let ((response (read-line)))
(setf (gethash (car question) responses) response)))))
;;; 生成提示词
(defun generate-prompt-text (inputs template)
"根据用户输入和模板生成提示词文本"
(format nil (prompt-template-base-prompt template)
(gethash "subject" inputs)
(gethash "activity" inputs)
(gethash "setting" inputs)
(gethash "color-scheme" inputs)
(gethash "mood" inputs)))
;;; 生成完整的JSON结构
(defun generate-json (inputs template)
"生成完整的JSON格式提示词"
(let ((prompt-text (generate-prompt-text inputs template))
(color-scheme (format nil "~A, soft pastels and subtle accents"
(gethash "color-scheme" inputs))))
(format nil "{
\"prompt\": \"~A\",
\"style\": \"~A\",
\"elements\": [
\"~A\",
\"~A\",
\"~A\",
\"~A\"
],
\"color_scheme\": \"~A\",
\"composition\": \"~A\",
\"aspect_ratio\": \"~A\",
\"additional_notes\": \"~A\"~A
}"
prompt-text
(prompt-template-style template)
(first (prompt-template-elements template))
(second (prompt-template-elements template))
(third (prompt-template-elements template))
(fourth (prompt-template-elements template))
color-scheme
(prompt-template-composition template)
(prompt-template-aspect-ratio template)
(prompt-template-additional-notes template)
(if (string= (gethash "special-elements" inputs) "")
""
(format nil ",
\"special_elements\": \"~A\"" (gethash "special-elements" inputs))))))
;;; 主函数 - 运行提示词生成器
(defun generate-prompt ()
"运行工笔画提示词生成器, 输出JSON格式结果"
(format t "~%~A~%~%"
"🖌️ 工笔画风格提示词生成器 | Gongbi-Style Prompt Generator 🖌️")
(format t "~A~%"
"请回答以下问题, 生成适合AI绘图的工笔画风格提示词:")
(let ((user-inputs (collect-user-input))
(template (make-prompt-template)))
(format t "~%~%📝 已生成工笔画风格提示词:~%~%")
(let ((json (generate-json user-inputs template)))
(format t "~A~%~%" json)
(format t "~%✅ 提示词生成完毕! 可复制以上JSON用于AI绘图工具.~%")
json)))
;;; 使用示例
;; (generate-prompt)