Smart Text Styler Pro (Node for Flux2klein)
📄 Description
Smart Text Styler Pro is a powerful custom node for ComfyUI, specifically designed to create highly stylized text and perfect typography for Flux2klein.


The node provides two synchronized outputs:
Layout Image (Mask): A clean text layout on a solid background, respecting precise positioning and professional Action Safe Areas.
Flux Optimized Prompt (String): An advanced instructional prompt that guides the AI to "texture" the letters while strictly preserving their shape and placement.
🚀 Key Features
Multi-line Support: Individual control over font size and letter spacing for every single line.
Layered Style System: A unique stacking logic: Material → Decoration → Action → Environment. Create complex combinations like "Rusty Metal + Bullet Holes + Burning + Sparks".
Triple Environment Slots: Add up to three atmospheric effects simultaneously (rain, lightning, smoke, glow).
Smart Background System: Choose from built-in presets (Underwater, Space, Cyberpunk City), use custom prompts, or a simple solid color.
Scene Interaction: A dedicated field to describe how the text physically interacts with the environment (e.g., "half-buried in sand", "floating in zero gravity").
Action Safe Area: Automatic 10% padding from the edges to ensure your text looks professional and never gets cropped.
⚙️ Settings Explained
📝 Text & Typography
text_lines: Enter your text here. Use Enter for new lines.
font: Choose any font from your /fonts folder (supports .ttf and .otf).
font_sizes: Comma-separated sizes (e.g., 120, 60). If there are more lines than values, the last value will repeat.
letter_spacing: Comma-separated spacing (e.g., 0, 5). Use this to stretch or compress specific lines.
line_spacing: Vertical distance between lines in pixels.
🎨 Canvas & Positioning
width / height: The output resolution of the layout image.
position: Alignment (Center, Top, Bottom-Left, etc.). Note: The node automatically applies an Action Safe Area (~10%) to prevent text from touching the edges.
canvas_color: Base color (Black, White, Transparent, etc.). Black is highly recommended for Flux workflows.
🧱 Style Core (Prompt Building Logic)
material: The base substance (Wood, Stone, Metal, Lava, Chocolate, Neon, etc.).
decoration: Surface details (Vines, Bullet Holes, Rust, Cracks, Tattoos).
action: Dynamic state (Burning, Melting, Exploding, Frozen).
environment_1, 2, 3: Atmospheric effects surrounding the text (Sparks, Smoke, Lightning, Snow).
🖼️ Background & Interaction
bg_mode:
simple: Uses the canvas_color.
preset: Choose from curated scenes (Underwater Corals, City Night Neon, Space Nebula, etc.).
custom: Enter your own background description.
scene_interaction: Crucial Field. Describes physical contact with the world.
Examples: "standing on the sandy bottom", "floating in zero gravity".
⚡ Advanced Settings
random_style: Enable to let the node randomly pick materials, actions, and effects.
extra_instruction: Add your own specific tokens to the final prompt.
style_mode: Lighting presets (Realistic, Creative, 3D Render).
intensity: Level of detail (adds "highly detailed" modifiers).
📥 Installation
Download the ComfyUI-SmartTextStyler folder and place it in ComfyUI/custom_nodes/.
Manage Fonts:
Navigate to ComfyUI/custom_nodes/ComfyUI-SmartTextStyler/fonts.
Cleanup: Delete any default fonts you don't need to keep your UI menu clean.
Add Your Own: Drop your favorite .ttf or .otf files into this folder.
Tip: High-contrast, bold, and display fonts work best for AI texturing!
Restart ComfyUI.
📝 Example "Scene Interaction" Phrases
Try these in the scene_interaction field for stunning results:
Underwater: Text resting on the sandy bottom, surrounded by tropical fish
Space: Text floating in zero gravity, faint star reflections on the surface
Cyberpunk: Text standing on wet asphalt, neon reflections in rain puddles
Forest: Text half-buried in thick green moss, ancient roots wrapping around the letters
Desert: Text half-buried in wind-swept sand dunes, heavy erosion details
The archive contains a node folder and a simple workflow.


















