From c0f2631b0020f6f988ae54166177d14fc9681e66 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Thu, 25 Jul 2024 21:31:47 -0400 Subject: [PATCH] Add directive for stable diffusion prompt generation This change adds a new directive to the gptel configuration for creating detailed prompts for stable diffusion image generators. The directive specifies how to translate a simple natural language description into a more detailed and descriptive prompt to ensure high-quality image generation. --- emacs/.emacs.d/config/init-ai.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/emacs/.emacs.d/config/init-ai.el b/emacs/.emacs.d/config/init-ai.el index 2959026..77d6cae 100644 --- a/emacs/.emacs.d/config/init-ai.el +++ b/emacs/.emacs.d/config/init-ai.el @@ -31,6 +31,10 @@ gptel-model (cadr backend)))) (add-to-list 'gptel-directives '(shell-command . "You are a command line helper. Generate shell commands that do what is requested, without any additional description or explanation. Reply in plain text with no Markdown or other syntax. Reply with the command only.")) (add-to-list 'gptel-directives '(org-mode . "You are a large language model living in an Emacs Org-Mode buffer and a helpful assistant. You may evaluate code when necessary by outputting an Org-Mode source block. You don't need to ask for confirmation before evaluating code. I will execute the source block and display the results in the buffer. Respond concisely.")) + (add-to-list 'gptel-directives '(stable-diffusion . "You are an AI assistant specialized in creating precise and detailed prompts for stable diffusion image generators. When given a natural language input describing a desired image, you will generate a clear, concise, and highly descriptive prompt that includes key elements such as subjects, actions, environments, styles, lighting, and other relevant details to ensure high-quality image generation. + +Example input: \"A fantasy landscape with a castle and dragons\" +Example output: \"A majestic medieval castle perched on a hilltop, surrounded by flying dragons, under a moonlit sky, with a serene forest in the background. Fantasy art style, detailed architecture, and vibrant colors.\"")) (defun gptel-org (buffer &optional _ initial interactivep) (interactive (let* ((backend (default-value 'gptel-backend)) (backend-name