{
  "workflow_info": {
    "name": "Flame Fractal Generator",
    "description": "Generate artistic flame fractals with various variations and color gradients",
    "version": "1.0.0",
    "author": "Lilith Platform",
    "category": "fractal",
    "tags": [
      "flame",
      "fractal",
      "ifs",
      "variations",
      "artistic",
      "organic"
    ],
    "estimated_time_seconds": 45,
    "gpu_requirement": "A5000"
  },
  "inputs": {
    "flame_style": {
      "type": "enum",
      "options": [
        "organic",
        "geometric",
        "spiraling",
        "flowing",
        "explosive",
        "crystalline",
        "ethereal",
        "cosmic"
      ],
      "default": "organic",
      "description": "Overall flame fractal style"
    },
    "variation_set": {
      "type": "enum",
      "options": [
        "linear_blend",
        "sinusoidal",
        "spherical",
        "swirl",
        "horseshoe",
        "polar",
        "handkerchief",
        "heart",
        "disc",
        "spiral",
        "hyperbolic",
        "diamond",
        "julia",
        "bent",
        "waves",
        "fisheye",
        "popcorn",
        "exponential",
        "power",
        "cosine",
        "rings",
        "fan",
        "blob",
        "pdj",
        "mixed"
      ],
      "default": "mixed",
      "description": "Primary variation functions"
    },
    "color_gradient": {
      "type": "enum",
      "options": [
        "fire",
        "ice",
        "nature",
        "cosmic",
        "rainbow",
        "monochrome",
        "sunset",
        "ocean",
        "neon",
        "earth"
      ],
      "default": "cosmic",
      "description": "Color gradient palette"
    },
    "symmetry": {
      "type": "enum",
      "options": [
        "none",
        "bilateral",
        "rotational_3",
        "rotational_4",
        "rotational_5",
        "rotational_6",
        "rotational_8",
        "dihedral"
      ],
      "default": "none",
      "description": "Symmetry type"
    },
    "density": {
      "type": "enum",
      "options": [
        "sparse",
        "medium",
        "dense",
        "ultra_dense"
      ],
      "default": "dense",
      "description": "Point density/iteration count"
    },
    "gamma": {
      "type": "enum",
      "options": [
        "low",
        "medium",
        "high",
        "very_high"
      ],
      "default": "medium",
      "description": "Gamma correction level"
    },
    "background": {
      "type": "enum",
      "options": [
        "black",
        "dark_gradient",
        "transparent",
        "nebula"
      ],
      "default": "black",
      "description": "Background style"
    },
    "post_processing": {
      "type": "enum",
      "options": [
        "none",
        "bloom",
        "sharpen",
        "enhance",
        "hdr"
      ],
      "default": "bloom",
      "description": "Post-processing effect"
    },
    "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": 40,
      "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"
    }
  },
  "style_prompts": {
    "organic": "organic flame fractal, natural flowing shapes, biological appearance, life-like curves, smooth transitions",
    "geometric": "geometric flame fractal, angular precision, mathematical shapes, structured patterns, clean edges",
    "spiraling": "spiraling flame fractal, rotating vortex, logarithmic spirals, hypnotic swirls, centrifugal motion",
    "flowing": "flowing flame fractal, liquid movement, water-like curves, graceful motion, fluid dynamics",
    "explosive": "explosive flame fractal, burst patterns, radiating energy, outward expansion, dynamic force",
    "crystalline": "crystalline flame fractal, faceted structure, gem-like qualities, refractive appearance, precious",
    "ethereal": "ethereal flame fractal, ghostly transparency, spiritual quality, otherworldly beauty, transcendent",
    "cosmic": "cosmic flame fractal, galactic scale, nebula-like, astronomical wonder, universe imagery"
  },
  "variation_prompts": {
    "linear_blend": "linear variation blend, basic transforms, foundational patterns, simple elegance",
    "sinusoidal": "sinusoidal variations, wave-based transforms, periodic patterns, undulating forms",
    "spherical": "spherical variation, inverse mapping, bubble-like effects, rounded transformations",
    "swirl": "swirl variation, rotating distortion, vortex effect, spinning transformation",
    "horseshoe": "horseshoe variation, folding transform, horseshoe-shaped distortion, unique topology",
    "polar": "polar coordinate variation, angular mapping, radial patterns, circular transforms",
    "handkerchief": "handkerchief variation, wave-folded pattern, fabric-like creases",
    "heart": "heart variation, cardioid shapes, romantic forms, curved hearts",
    "disc": "disc variation, circular mapping, plate-like forms, round patterns",
    "spiral": "spiral variation, Archimedean spirals, coiling patterns, winding forms",
    "hyperbolic": "hyperbolic variation, saddle shapes, mathematical curves, infinite extent",
    "diamond": "diamond variation, gem-like facets, angular reflections, precious patterns",
    "julia": "julia variation, complex plane mapping, fractal within fractal, recursive beauty",
    "bent": "bent variation, angled distortion, kinked shapes, corner effects",
    "waves": "waves variation, sinusoidal distortion, ocean-like patterns, rhythmic undulation",
    "fisheye": "fisheye variation, lens distortion, spherical projection, wide-angle effect",
    "popcorn": "popcorn variation, scattered distortion, chaotic displacement, random feel",
    "exponential": "exponential variation, growth mapping, expanding patterns, mathematical growth",
    "power": "power variation, polynomial distortion, intensity-based transform",
    "cosine": "cosine variation, trigonometric mapping, periodic transforms, wave patterns",
    "rings": "rings variation, concentric circles, ripple effect, ring patterns",
    "fan": "fan variation, angular spreading, radial sectors, spoke patterns",
    "blob": "blob variation, organic bulging, amorphous shapes, soft edges",
    "pdj": "PDJ variation, parametric transform, four-parameter, complex patterns",
    "mixed": "mixed variations, multiple transforms combined, complex interaction, rich patterns"
  },
  "color_prompts": {
    "fire": "fire gradient, red orange yellow white, burning flame, heat colors, combustion",
    "ice": "ice gradient, blue white cyan, frozen crystal, cold colors, arctic",
    "nature": "nature gradient, green brown gold, forest colors, earth and leaf",
    "cosmic": "cosmic gradient, purple blue pink, nebula colors, galactic palette",
    "rainbow": "rainbow gradient, full spectrum, all colors, prismatic, complete wheel",
    "monochrome": "monochrome gradient, single hue variations, elegant simplicity, tonal depth",
    "sunset": "sunset gradient, orange pink purple, twilight colors, dusk palette",
    "ocean": "ocean gradient, blue teal aqua, water colors, sea tones",
    "neon": "neon gradient, electric bright, fluorescent glow, cyberpunk palette",
    "earth": "earth gradient, brown ochre sienna, natural pigments, soil colors"
  },
  "symmetry_prompts": {
    "none": "asymmetric natural form, organic irregularity, free composition",
    "bilateral": "bilateral mirror symmetry, left-right reflection, butterfly-like",
    "rotational_3": "three-fold rotational symmetry, triangular balance, triskelion-like",
    "rotational_4": "four-fold rotational symmetry, square balance, cross pattern",
    "rotational_5": "five-fold rotational symmetry, pentagonal balance, starfish-like",
    "rotational_6": "six-fold rotational symmetry, hexagonal balance, snowflake-like",
    "rotational_8": "eight-fold rotational symmetry, octagonal balance, compass rose",
    "dihedral": "dihedral symmetry, reflection and rotation combined, kaleidoscope"
  },
  "density_prompts": {
    "sparse": "sparse iteration, light detail, clear structure, airy composition",
    "medium": "medium density, balanced detail, clear but rich, readable complexity",
    "dense": "dense iteration, rich detail, complex filling, substantial patterns",
    "ultra_dense": "ultra dense iteration, maximum detail, complete filling, overwhelming beauty"
  },
  "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 shapes, non-fractal, photographic, human faces, text watermark, ugly, pixelated",
        "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": "flame_fractal"
      },
      "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": "flame fractal art, {style_prompt}, {variation_prompt}, {color_prompt}, {symmetry_prompt}, {density_prompt}, IFS iterated function system, fractal flame algorithm, Draves and Reckase, glowing luminescent, log-density display, highly detailed, beautiful mathematical art",
    "variables": {
      "style_prompt": "{{style_prompts[flame_style]}}",
      "variation_prompt": "{{variation_prompts[variation_set]}}",
      "color_prompt": "{{color_prompts[color_gradient]}}",
      "symmetry_prompt": "{{symmetry_prompts[symmetry]}}",
      "density_prompt": "{{density_prompts[density]}}"
    }
  },
  "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"
  ]
}
