how to add more samplers to krita ai generation tool

how to add more samplers to krita ai generation tool

Krita’s AI Diffusion plugin bridges digital art and generative AI, letting you create stunning visuals with text prompts. While the plugin comes with essential samplers (like Euler or LMS), expanding your sampler library unlocks finer control over image quality, style, and generation speed. This guide walks you through adding new samplers to supercharge your AI art workflow.


Why Samplers Matter

Samplers are algorithms that translate AI noise into coherent images. Each has unique strengths:

  • Euler a: Fast and artistic (great for abstract styles).
  • DPM++ 2M: Balanced quality/speed (ideal for detailed work).
  • DDIM: Deterministic outputs (perfect for iterations).
  • UniPC: Speed demon (quick drafts).
    Adding niche samplers (e.g., DPM++ SDE Karras or custom ComfyUI nodes) lets you tailor results to your project’s needs.

Prerequisites

  1. Krita AI Diffusion Plugin:
    Install from GitHub or via Krita’s Tools > Scripts > Import Python Plugin.
  2. Compatible Backend:
  • Automatic1111 WebUI (most user-friendly).
  • ComfyUI (for advanced customization).
  1. Updated Software:
    Ensure Krita, the plugin, and your backend are updated to the latest versions.

Step-by-Step: Adding New Samplers

Samplers are managed by your backend (Automatic1111/ComfyUI), not Krita. Follow these steps:

1. Update Your Backend

New samplers are added via backend updates.

For Automatic1111 Users:

  • Open your stable-diffusion-webui folder.
  • Run these commands:
  git pull  # Fetches latest updates (including new samplers)
  • Restart the backend by relaunching webui-user.bat (Windows) or webui.sh (Linux/macOS).

For ComfyUI Users:

  • Navigate to your ComfyUI directory:
  git pull
  • Install custom sampler nodes via ComfyUI Manager:
  1. Launch ComfyUI and open the Manager.
  2. Search for “sampler” packs (e.g., ComfyUI_Custom_Samplers).
  3. Click Install and restart ComfyUI.

2. Refresh Samplers in Krita

  1. Open Krita and go to Settings > Configure Krita > AI Diffusion.
  2. Under the Backend tab, click Refresh next to “Samplers”:
    Refresh Samplers
  3. New samplers will appear in the dropdown.

3. Manual Addition (If Auto-Refresh Fails)

Edit the plugin’s config file:

  • Windows: %APPDATA%\krita\pykrita\ai_diffusion\config.json
  • Linux/macOS: ~/.config/krita/pykrita/ai_diffusion/config.json

Add samplers to the array:

{
  "backends": {
    "auto1111": {
      "samplers": ["Euler", "LMS", "DPM++ 2M", "DPM++ SDE Karras", "UniPC", "Your_New_Sampler"]
    }
  }
}


Save the file and restart Krita.


Troubleshooting Common Issues

  • Samplers not appearing?
  • Verify your backend is running at http://localhost:7860 (Automatic1111) or http://localhost:8188 (ComfyUI).
  • Test the backend’s API:
    bash curl http://localhost:7860/sdapi/v1/samplers # Should return a JSON list
  • Reinstall the Krita plugin via Tools > Scripts > Import Python Plugin.
  • Backend connection errors?
  • Check firewall settings blocking localhost.
  • Ensure the backend URL matches in Krita > Settings > AI Diffusion > Backend.
  • Custom samplers not working?
  • For ComfyUI, confirm nodes are installed via the Manager.
  • For Automatic1111, check modules/sd_samplers.py for sampler definitions (advanced users only).

Pro Tips for Sampler Mastery

  1. Experiment: Test samplers with low steps (10-20) to compare speed/quality.
  2. Combine with CFG Scale: Lower values (e.g., 5-7) reduce sampler “burn-in” artifacts.
  3. Batch Processing: Use fast samplers (e.g., UniPC) for drafts, then refine with DPM++ 2M.
  4. Stay Updated: Backend updates often add new samplers—run git pull monthly!

Conclusion

Expanding Krita’s AI sampler library transforms generative art from a novelty into a precision tool. Whether you’re chasing photorealism with DPM++ 3M SDE or abstract chaos with Euler a, these steps put you in control. Remember: the backend is your playground—keep it updated, experiment boldly, and let your creativity flow!

Resources:

🎨 Happy generating!

Leave a Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post