Skip to main content
Glama
dmarsters

Constellation Composition MCP Server

by dmarsters

generate_constellation_attractor_prompt

Convert 5D constellation coordinates into image-generation prompts for Stable Diffusion, ComfyUI, DALL-E, or Midjourney using three output modes.

Instructions

Generate image-generation-ready prompts from 5D constellation coordinates.

Layer 2: Deterministic vocabulary extraction (0 tokens).

Translates abstract parameter coordinates into concrete visual vocabulary suitable for Stable Diffusion, ComfyUI, DALL-E, or Midjourney. Three output modes are available:

  • composite: Single prompt string combining keywords and geometric specs. Best for direct image generation.

  • split_keywords: Categorized keyword lists (visual type, specifications, parameter descriptors). Best for ComfyUI prompt engineering.

  • descriptive: Narrative paragraph prompt. Best for DALL-E / Midjourney.

Coordinates can be provided directly, or derived from a canonical state name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYesInput for generating image-generation prompts from attractor coordinates.

Implementation Reference

  • The handler function 'generate_constellation_attractor_prompt' which takes AttractorPromptInput to generate image prompts. It uses visual vocabulary types and parameter coordinates.
    async def generate_constellation_attractor_prompt(params: AttractorPromptInput) -> str:
        """
        Generate image-generation-ready prompts from 5D constellation coordinates.
    
        Layer 2: Deterministic vocabulary extraction (0 tokens).
    
        Translates abstract parameter coordinates into concrete visual vocabulary
        suitable for Stable Diffusion, ComfyUI, DALL-E, or Midjourney. Three
        output modes are available:
    
        - **composite**: Single prompt string combining keywords and geometric specs.
          Best for direct image generation.
        - **split_keywords**: Categorized keyword lists (visual type, specifications,
          parameter descriptors). Best for ComfyUI prompt engineering.
        - **descriptive**: Narrative paragraph prompt. Best for DALL-E / Midjourney.
    
        Coordinates can be provided directly, or derived from a canonical state name.
        """
        # Resolve coordinates
        if params.coordinates:
            coords = params.coordinates
            # Fill missing params with 0.5 default
            for p in CONSTELLATION_PARAMETER_NAMES:
                if p not in coords:
                    coords[p] = 0.5
        elif params.canonical_state:
            state = CONSTELLATION_CANONICAL_STATES[params.canonical_state]
            coords = {p: state[p] for p in CONSTELLATION_PARAMETER_NAMES}
        else:
            return json.dumps({
                "error": "Provide either 'coordinates' dict or 'canonical_state' name"
            })
    
        vocab = _extract_visual_vocabulary(coords, params.strength)
    
        if params.mode == "composite":
            prompt = _generate_composite_prompt(coords, params.strength)
            return json.dumps({
                "mode": "composite",
                "prompt": prompt,
                "nearest_visual_type": vocab["nearest_type"],
                "type_distance": vocab["distance"],
                "coordinates": coords
            }, indent=2)
    
        elif params.mode == "split_keywords":
            # Build categorized keyword sets
            specs = {}
            sd = coords.get("stellar_density", 0.5)
            specs["density"] = (
                "dense rich starfield" if sd > 0.7
                else "sparse isolated stars" if sd < 0.3
                else "moderate star density"
            )
            gr = coords.get("geometric_regularity", 0.5)
            specs["geometry"] = (
                "precise geometric arrangement" if gr > 0.7
                else "organic flowing forms" if gr < 0.3
                else "naturally balanced arrangement"
            )
            lc = coords.get("luminance_contrast", 0.5)
            specs["luminance"] = (
                "extreme brightness contrast" if lc > 0.7
                else "soft even luminosity" if lc < 0.3
                else "moderate contrast"
            )
            ni = coords.get("narrative_intensity", 0.5)
            specs["mood"] = (
                "dramatic mythological atmosphere" if ni > 0.7
                else "contemplative quiet mood" if ni < 0.3
                else "balanced narrative tone"
            )
            se = coords.get("spatial_extent", 0.5)
            specs["scale"] = (
                "wide panoramic field" if se > 0.7
                else "intimate compact framing" if se < 0.3
                else "moderate field of view"
            )
    
            return json.dumps({
                "mode": "split_keywords",
                "visual_type_keywords": vocab["keywords"],
                "parameter_descriptors": specs,
                "nearest_visual_type": vocab["nearest_type"],
                "type_distance": vocab["distance"],
                "coordinates": coords
            }, indent=2)
    
        else:  # descriptive
            prompt = _generate_descriptive_prompt(coords, params.strength)
            return json.dumps({
                "mode": "descriptive",
                "prompt": prompt,
                "nearest_visual_type": vocab["nearest_type"],
                "type_distance": vocab["distance"],
                "coordinates": coords
            }, indent=2)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dmarsters/constellation-composition-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server