Unlock Professional AI Art Prompts with DeepSeek-R1 32B LLM

CN
ComfyUI.org
2025-04-03 10:17:48

1. Workflow Overview

m917c5wacykrzybdeg26580f7c2b6cc628cc7c9a3d547250394f317844387cb27e7c631802a1a6f6b5.jpg

This workflow integrates DeepSeek-R1 32B LLM to automatically optimize AI art prompts, featuring:

  • Transforming basic descriptions (e.g., "astronaut, dark sun, close-up") into professional-grade prompts

  • Auto-adding lighting/material details and emotional tones

  • Privacy-focused via Ollama local API

2. Core Components

Component

Function

deepseek-r1:32b

DeepSeek model (local via Ollama) for text refinement

TextSplitByDelimiter

Extracts key content between <think> tags

PurgeVRAM

Cleans GPU memory post-generation

3. Key Nodes

  • Prompt Optimization Group

    • OllamaGenerateAdvance:

      • Input: Raw prompt (e.g., "astronaut, dark sun, close-up")

      • Parameters: temperature=0.9, top_p=0.8 (creativity control)

      • System Prompt: Requires 3-5 artistic elements + lighting/emotion details

    • TextSplitByDelimiter:

      • Splits output by <think>/</think> delimiters

  • Output & Cleanup

    • ShowText|pysssss: Displays final optimized prompt

    • PurgeVRAM: Memory cleanup (critical for low-VRAM devices)

4. Dependencies

  • Required Plugins:

    • ComfyUI-Ollama (local API connection)

    • pysssss (text display enhancement)

  • Setup:

    • Local Ollama service (http://127.0.0.1:11434)

    • Model download: ollama pull deepseek-r1:32b

5. Input Parameters

  • Mandatory:

    • Base prompt (e.g., "astronaut, dark sun, close-up")

  • Tunable:

    • max_tokens=40 (output length control)

    • repeat_penalty=1 (reduces repetition)

6. Notes

⚠️ Requires 24GB+ VRAM (32B model size)
⚠️ Initial model loading takes 3-10 minutes
⚠️ Output includes <think> tags (remove manually)