The Text Encode Sampler Params node combines text encoding with sampler parameter management, providing a unified interface for prompt processing and sampling configuration. Adapted from comfyui-essentials-nodes (now in maintenance mode), this tool streamlines the text-to-image pipeline setup.
This node is based on work from comfyui-essentials-nodes by cubiq. The original project is in maintenance-only mode, and we've adopted and enhanced these tools to ensure continued support and compatibility with modern ComfyUI workflows.
- Unified Interface: Combine text encoding and sampler params in one node
- Dynamic Prompt Processing: Support for wildcards and syntax
- Parameter Templates: Pre-configured settings for common scenarios
- Batch Text Processing: Handle multiple prompts efficiently
- Model-Aware Encoding: Optimize for different text encoders
- Category:
ComfyAssets/🧰 xyz-helpers - Node Name:
TextEncodeSamplerParams - Function:
encode_and_params
| Parameter | Type | Default | Description |
|---|---|---|---|
text |
STRING | - | Prompt text to encode |
clip |
CLIP | - | CLIP model for encoding |
sampler_name |
DROPDOWN | dpmpp_2m | Sampling algorithm |
scheduler |
DROPDOWN | karras | Noise scheduler |
steps |
INT | 20 | Sampling steps |
cfg |
FLOAT | 7.0 | CFG scale |
| Parameter | Type | Default | Description |
|---|---|---|---|
negative_text |
STRING | "" | Negative prompt |
seed |
INT | -1 | Random seed (-1 for random) |
denoise |
FLOAT | 1.0 | Denoising strength |
template |
DROPDOWN | none | Parameter template |
| Name | Type | Description |
|---|---|---|
positive |
CONDITIONING | Encoded positive prompt |
negative |
CONDITIONING | Encoded negative prompt |
sampler_params |
DICT | Complete sampler parameters |
template: "portrait"
→ steps: 25
→ cfg: 7.5
→ sampler: dpmpp_2m_sde
→ scheduler: karrastemplate: "landscape"
→ steps: 30
→ cfg: 8.0
→ sampler: dpmpp_3m_sde
→ scheduler: exponentialtemplate: "preview"
→ steps: 12
→ cfg: 6.0
→ sampler: euler
→ scheduler: normaltemplate: "detailed"
→ steps: 40
→ cfg: 7.0
→ sampler: dpm_adaptive
→ scheduler: karrasTextEncodeSamplerParams → KSampler → VAE Decode
text: "beautiful landscape"
negative_text: "ugly, blurry"
steps: 20
TextEncodeSamplerParams → KSampler
text: "portrait of a person"
template: "portrait"
→ Optimized portrait settings
Multiple Prompts → TextEncodeSamplerParams → Batch Generate
→ Encode all prompts with same settings
{red|blue|green} car
→ Randomly selects color
(important:1.2) detail
→ Increases weight to 1.2
[cat|dog] in garden
→ Alternates between options
- Keep prompts concise and descriptive
- Use emphasis for important elements
- Structure prompts logically
- Test negative prompts impact
# Quality over speed
steps: 30-40
cfg: 7-8
sampler: dpmpp_3m_sde
# Speed over quality
steps: 10-15
cfg: 5-6
sampler: euler# Common negatives
"ugly, tiling, poorly drawn, out of frame"
# Style-specific
"cartoon, anime" (for realism)
"realistic, photo" (for artwork)TextEncodeSamplerParams → KSampler → VAE Decode
↓ ↑
All parameters From Model Loader
LoRAFolderBatch → TextEncodeSamplerParams → Generate
→ Apply LoRA to encoded text
TextEncodeSamplerParams → First Pass (low res)
↘ Second Pass (high res)
# Load template based on prompt content
if "portrait" in text:
use_template("portrait")
elif "landscape" in text:
use_template("landscape")# Automatic weight calculation
analyze_prompt_importance()
apply_semantic_weights()- Adjust CLIP layers used
- Model-specific optimization
- Quality vs style balance
- Front-load important elements
- Use commas for separation
- Avoid contradictions
- Test with different CFG values
# Memory efficient
encode_in_batches = True
clear_cache_between = True
# Speed priority
use_half_precision = True
minimize_conditioning = True- Higher CFG for prompt adherence
- Lower CFG for creativity
- Balance with step count
Reference Image → Extract Style
↓
TextEncodeSamplerParams → Apply Style
text: "in the style of [extracted]"
Base Prompt → Variations → TextEncodeSamplerParams
→ Test different phrasings
Same prompt → Different parameters → Compare
template A vs template B
- Increase CFG scale
- Simplify prompt
- Check CLIP model compatibility
- Reduce CFG scale
- Adjust negative prompt
- Check sampler settings
- Verify CLIP model loaded
- Check text formatting
- Remove special characters
Low (3-5): Creative, loose interpretation
Medium (6-8): Balanced adherence
High (9-12): Strict prompt following
Very High (13+): Potential artifacts
Low (10-15): Fast, rough
Medium (20-30): Good balance
High (40-50): Maximum quality
Very High (50+): Diminishing returns
- CFG: 6-8
- CLIP Skip: 1-2
- Emphasis: Moderate
- CFG: 7-9
- CLIP Skip: 1-2
- Emphasis: Standard
- CFG: 3-5
- CLIP Skip: 0
- Emphasis: Subtle
- 1.0.0: Initial adaptation from comfyui-essentials-nodes
- 1.0.1: Added template system
- 1.0.2: Enhanced prompt syntax support
- 1.0.3: Improved batch processing
Original implementation by cubiq in comfyui-essentials-nodes. Adapted and maintained by the ComfyAssets team.