{
  "workflow_info": {
    "name": "Lorenz Attractor Generator",
    "description": "Generate artistic renderings of the Lorenz attractor and other strange attractors",
    "version": "1.0.0",
    "author": "Lilith Platform",
    "category": "fractal",
    "tags": [
      "lorenz",
      "attractor",
      "chaos",
      "butterfly",
      "dynamical",
      "strange"
    ],
    "estimated_time_seconds": 40,
    "gpu_requirement": "A5000"
  },
  "inputs": {
    "attractor_type": {
      "type": "enum",
      "options": [
        "lorenz",
        "rossler",
        "thomas",
        "aizawa",
        "chen",
        "halvorsen",
        "sprott",
        "dadras"
      ],
      "default": "lorenz",
      "description": "Type of strange attractor"
    },
    "view_angle": {
      "type": "enum",
      "options": [
        "classic_butterfly",
        "top_down",
        "side_view",
        "dynamic_rotation",
        "close_focus",
        "wide_angle"
      ],
      "default": "classic_butterfly",
      "description": "Viewing angle perspective"
    },
    "color_scheme": {
      "type": "enum",
      "options": [
        "velocity",
        "time",
        "gradient",
        "monochrome",
        "temperature",
        "rainbow",
        "cosmic",
        "fire"
      ],
      "default": "velocity",
      "description": "Coloring method"
    },
    "rendering_style": {
      "type": "enum",
      "options": [
        "line_trace",
        "point_cloud",
        "tubes",
        "ribbons",
        "glowing_threads",
        "smoke"
      ],
      "default": "glowing_threads",
      "description": "Rendering style"
    },
    "trail_length": {
      "type": "enum",
      "options": [
        "short",
        "medium",
        "long",
        "infinite"
      ],
      "default": "long",
      "description": "Length of trajectory trails"
    },
    "background": {
      "type": "enum",
      "options": [
        "black_void",
        "dark_gradient",
        "cosmic",
        "grid",
        "abstract"
      ],
      "default": "black_void",
      "description": "Background style"
    },
    "artistic_style": {
      "type": "enum",
      "options": [
        "mathematical",
        "organic",
        "ethereal",
        "mechanical",
        "mystical"
      ],
      "default": "ethereal",
      "description": "Artistic interpretation"
    },
    "glow_intensity": {
      "type": "enum",
      "options": [
        "none",
        "subtle",
        "moderate",
        "intense",
        "blazing"
      ],
      "default": "moderate",
      "description": "Glow/bloom intensity"
    },
    "seed": {
      "type": "integer",
      "default": -1,
      "description": "Random seed"
    },
    "width": {
      "type": "integer",
      "default": 1024,
      "description": "Output width"
    },
    "height": {
      "type": "integer",
      "default": 1024,
      "description": "Output height"
    },
    "steps": {
      "type": "integer",
      "default": 35,
      "description": "Sampling steps"
    },
    "cfg_scale": {
      "type": "float",
      "default": 7.5,
      "description": "CFG scale"
    },
    "hires_fix": {
      "type": "boolean",
      "default": true,
      "description": "Two-pass detail refinement: 1.5x latent upscale + low-denoise second sampling pass"
    },
    "freeu": {
      "type": "boolean",
      "default": true,
      "description": "FreeU v2 backbone re-weighting (family-tuned b1/b2/s1/s2)"
    },
    "checkpoint": {
      "type": "enum",
      "options": [
        "realvis_xl_v5",
        "sdxl_base"
      ],
      "default": "sdxl_base",
      "description": "SDXL checkpoint: curated photoreal finetune (default) or base 1.0"
    }
  },
  "attractor_prompts": {
    "lorenz": "Lorenz attractor, butterfly effect chaos, two-lobed structure, Edward Lorenz discovery, atmospheric convection model",
    "rossler": "Rossler attractor, single spiral loop, simpler chaotic system, Otto Rossler, asymmetric orbit",
    "thomas": "Thomas attractor, cyclically symmetric, three-dimensional flow, smooth curves, organic shapes",
    "aizawa": "Aizawa attractor, torus-like structure, Japanese mathematician, unique topology, twisted form",
    "chen": "Chen attractor, double scroll, Guanrong Chen, Chinese mathematician, symmetric chaos",
    "halvorsen": "Halvorsen attractor, symmetric cyclical, Norwegian mathematician, three-fold symmetry, elegant curves",
    "sprott": "Sprott attractor, simple equations, Julien Sprott, minimal chaos, efficient strange attractor",
    "dadras": "Dadras attractor, four-wing butterfly, complex topology, Iranian mathematician, elaborate structure"
  },
  "view_prompts": {
    "classic_butterfly": "classic butterfly view, iconic perspective, two wings visible, recognizable shape",
    "top_down": "top down view, looking down axis, circular patterns visible, bird's eye view",
    "side_view": "side profile view, single lobe prominent, depth visible, lateral perspective",
    "dynamic_rotation": "dynamic rotating view, multiple angles implied, motion blur, spinning perspective",
    "close_focus": "close focus detail, zoomed in section, intricate trajectory detail, micro view",
    "wide_angle": "wide angle full view, complete structure visible, spatial context, comprehensive"
  },
  "color_prompts": {
    "velocity": "velocity-based coloring, speed determines hue, fast areas bright, slow areas dark",
    "time": "time-based coloring, trajectory age colors, rainbow progression, temporal gradient",
    "gradient": "smooth gradient coloring, position-based hue, spatial color mapping",
    "monochrome": "monochrome single color, elegant simplicity, tonal variation, sophisticated",
    "temperature": "temperature heat map, hot and cold regions, thermal visualization, infrared style",
    "rainbow": "full rainbow spectrum, all colors represented, prismatic chaos, vibrant diversity",
    "cosmic": "cosmic space colors, nebula palette, stellar hues, astronomical beauty",
    "fire": "fire flame colors, red orange yellow, burning chaos, heat and energy"
  },
  "rendering_prompts": {
    "line_trace": "line trace rendering, continuous trajectory, single pixel width, pure mathematical",
    "point_cloud": "point cloud rendering, discrete points, particle system, scattered dots",
    "tubes": "3D tube rendering, cylindrical trajectories, depth and volume, substantial paths",
    "ribbons": "ribbon rendering, flat twisted bands, flowing fabric, elegant curves",
    "glowing_threads": "glowing thread rendering, luminescent lines, neon paths, light trails",
    "smoke": "smoke trail rendering, diffuse particles, atmospheric effect, ethereal wisps"
  },
  "trail_prompts": {
    "short": "short trajectory trails, recent history only, clean minimal, focused current",
    "medium": "medium length trails, moderate history, balanced view, clear structure",
    "long": "long trajectory trails, extensive history, dense filling, complete pattern",
    "infinite": "infinite trails, all history visible, fully filled attractor, maximum density"
  },
  "background_prompts": {
    "black_void": "pure black void background, stark contrast, floating in darkness, isolated",
    "dark_gradient": "dark gradient background, subtle variation, professional presentation, depth",
    "cosmic": "cosmic nebula background, stars and space, universal context, astronomical setting",
    "grid": "coordinate grid background, mathematical context, axis visible, scientific visualization",
    "abstract": "abstract artistic background, complementary patterns, artistic context, creative setting"
  },
  "artistic_prompts": {
    "mathematical": "pure mathematical visualization, scientific accuracy, academic presentation, precise",
    "organic": "organic living interpretation, biological resemblance, natural growth, life-like",
    "ethereal": "ethereal mystical interpretation, ghostly presence, spiritual quality, transcendent",
    "mechanical": "mechanical industrial interpretation, metallic quality, engineered appearance, technical",
    "mystical": "mystical magical interpretation, arcane symbols, esoteric quality, mysterious power"
  },
  "glow_prompts": {
    "none": "no glow effect, clean lines, sharp edges",
    "subtle": "subtle soft glow, gentle luminescence, delicate light",
    "moderate": "moderate glow effect, visible bloom, attractive luminosity",
    "intense": "intense bright glow, strong bloom, eye-catching luminescence",
    "blazing": "blazing maximum glow, overwhelming light, brilliant radiance, nuclear intensity"
  },
  "nodes": {
    "1": {
      "class_type": "CheckpointLoaderSimple",
      "inputs": {
        "ckpt_name": "{{checkpoint_files[checkpoint]}}"
      },
      "outputs": [
        "MODEL",
        "CLIP",
        "VAE"
      ]
    },
    "2": {
      "class_type": "CLIPTextEncode",
      "inputs": {
        "text": "{{constructed_prompt}}",
        "clip": [
          "1",
          1
        ]
      },
      "outputs": [
        "CONDITIONING"
      ]
    },
    "3": {
      "class_type": "CLIPTextEncode",
      "inputs": {
        "text": "blurry, low quality, simple, non-chaotic, regular pattern, human faces, text watermark, photograph",
        "clip": [
          "1",
          1
        ]
      },
      "outputs": [
        "CONDITIONING"
      ]
    },
    "4": {
      "class_type": "EmptyLatentImage",
      "inputs": {
        "width": "{{width}}",
        "height": "{{height}}",
        "batch_size": 1
      },
      "outputs": [
        "LATENT"
      ]
    },
    "5": {
      "class_type": "KSampler",
      "inputs": {
        "model": [
          "freeu",
          0
        ],
        "positive": [
          "2",
          0
        ],
        "negative": [
          "3",
          0
        ],
        "latent_image": [
          "4",
          0
        ],
        "seed": "{{seed}}",
        "steps": "{{steps}}",
        "cfg": "{{cfg_scale}}",
        "sampler_name": "dpmpp_2m_sde",
        "scheduler": "karras",
        "denoise": 1.0
      },
      "outputs": [
        "LATENT"
      ]
    },
    "6": {
      "class_type": "VAEDecode",
      "inputs": {
        "samples": [
          "hires_sampler",
          0
        ],
        "vae": [
          "1",
          2
        ]
      },
      "outputs": [
        "IMAGE"
      ]
    },
    "7": {
      "class_type": "SaveImage",
      "inputs": {
        "images": [
          "6",
          0
        ],
        "filename_prefix": "lorenz_attractor"
      },
      "outputs": []
    },
    "freeu": {
      "class_type": "FreeU_V2",
      "inputs": {
        "model": [
          "1",
          0
        ],
        "b1": 1.1,
        "b2": 1.2,
        "s1": 0.6,
        "s2": 0.4
      },
      "outputs": [
        "MODEL"
      ],
      "_condition": "{{freeu}}",
      "_comment": "FreeU v2 with known-good sdxl parameters."
    },
    "hires_upscale": {
      "class_type": "LatentUpscaleBy",
      "inputs": {
        "samples": [
          "5",
          0
        ],
        "upscale_method": "bislerp",
        "scale_by": 1.5
      },
      "outputs": [
        "LATENT"
      ],
      "_condition": "{{hires_fix}}"
    },
    "hires_sampler": {
      "class_type": "KSampler",
      "inputs": {
        "model": [
          "freeu",
          0
        ],
        "positive": [
          "2",
          0
        ],
        "negative": [
          "3",
          0
        ],
        "latent_image": [
          "hires_upscale",
          0
        ],
        "seed": "{{seed}}",
        "steps": 14,
        "cfg": "{{cfg_scale}}",
        "sampler_name": "dpmpp_2m",
        "scheduler": "karras",
        "denoise": 0.45
      },
      "outputs": [
        "LATENT"
      ],
      "_condition": "{{hires_fix}}",
      "_condition_passthrough": "latent_image",
      "_comment": "Hires second pass: refine structure from the 1.5x upscaled latent."
    }
  },
  "prompt_construction": {
    "template": "strange attractor visualization, {attractor_prompt}, {view_prompt}, {color_prompt}, {rendering_prompt}, {trail_prompt}, {background_prompt}, {artistic_prompt}, {glow_prompt}, chaos theory mathematics, dynamical systems, butterfly effect, deterministic chaos, highly detailed",
    "variables": {
      "attractor_prompt": "{{attractor_prompts[attractor_type]}}",
      "view_prompt": "{{view_prompts[view_angle]}}",
      "color_prompt": "{{color_prompts[color_scheme]}}",
      "rendering_prompt": "{{rendering_prompts[rendering_style]}}",
      "trail_prompt": "{{trail_prompts[trail_length]}}",
      "background_prompt": "{{background_prompts[background]}}",
      "artistic_prompt": "{{artistic_prompts[artistic_style]}}",
      "glow_prompt": "{{glow_prompts[glow_intensity]}}"
    }
  },
  "output_spec": {
    "type": "image",
    "format": "png",
    "channels": 4
  },
  "checkpoint_files": {
    "realvis_xl_v5": "RealVisXL_V5.0_fp16.safetensors",
    "sdxl_base": "sd_xl_base_1.0.safetensors"
  },
  "models_required": [
    "RealVisXL_V5.0_fp16.safetensors",
    "sd_xl_base_1.0.safetensors"
  ]
}
