{
 "schema_version": "1.0",
 "nodes": [
  {
   "id": "product",
   "type": "input/image",
   "label": "The real jacket",
   "parameters": {
    "image": "__JACKET__",
    "required": true
   },
   "position": {
    "x": 0,
    "y": 500
   }
  },
  {
   "id": "cut_real",
   "type": "ai/remove_background",
   "label": "Jacket alone",
   "parameters": {},
   "position": {
    "x": 320,
    "y": 500
   }
  },
  {
   "id": "real_tone",
   "type": "image/statistics",
   "label": "Its tone and colour",
   "parameters": {},
   "position": {
    "x": 640,
    "y": 420
   }
  },
  {
   "id": "real_detail",
   "type": "image/detail",
   "label": "Its texture",
   "parameters": {},
   "position": {
    "x": 640,
    "y": 600
   }
  },
  {
   "id": "shot_studio",
   "type": "ai/product_photography",
   "label": "Studio packshot",
   "parameters": {
    "surface": "white_seamless",
    "lighting": "soft_diffused",
    "angle": "front",
    "aspect_ratio": "4_5"
   },
   "position": {
    "x": 320,
    "y": 0
   }
  },
  {
   "id": "cut_studio",
   "type": "ai/remove_background",
   "label": "Studio packshot: jacket alone",
   "parameters": {},
   "position": {
    "x": 640,
    "y": 0
   }
  },
  {
   "id": "tone_studio",
   "type": "image/statistics",
   "label": "Studio packshot: tone and colour",
   "parameters": {},
   "position": {
    "x": 960,
    "y": -80
   }
  },
  {
   "id": "detail_studio",
   "type": "image/detail",
   "label": "Studio packshot: texture",
   "parameters": {},
   "position": {
    "x": 960,
    "y": 100
   }
  },
  {
   "id": "colour_studio",
   "type": "utility/calculate",
   "label": "Studio packshot: colour shift",
   "parameters": {
    "expression": "abs(shot.global.oklab.mean_a - real.global.oklab.mean_a) + abs(shot.global.oklab.mean_b - real.global.oklab.mean_b)",
    "decimals": 4
   },
   "position": {
    "x": 1280,
    "y": -120
   }
  },
  {
   "id": "light_studio",
   "type": "utility/calculate",
   "label": "Studio packshot: light change",
   "parameters": {
    "expression": "abs(shot.global.luma.p50 - real.global.luma.p50)",
    "decimals": 4
   },
   "position": {
    "x": 1280,
    "y": 0
   }
  },
  {
   "id": "texture_studio",
   "type": "utility/calculate",
   "label": "Studio packshot: texture kept",
   "parameters": {
    "expression": "shot.global.residual_mad_3 / real.global.residual_mad_3",
    "decimals": 3
   },
   "position": {
    "x": 1280,
    "y": 120
   }
  },
  {
   "id": "colour_ok_studio",
   "type": "utility/predicate",
   "label": "Studio packshot: colour shift at most 0.02",
   "parameters": {
    "operation": "less_or_equal",
    "compare_number": 0.02
   },
   "position": {
    "x": 1600,
    "y": -120
   }
  },
  {
   "id": "light_ok_studio",
   "type": "utility/predicate",
   "label": "Studio packshot: light change at most 0.12",
   "parameters": {
    "operation": "less_or_equal",
    "compare_number": 0.12
   },
   "position": {
    "x": 1600,
    "y": 0
   }
  },
  {
   "id": "texture_ok_studio",
   "type": "utility/predicate",
   "label": "Studio packshot: texture kept at least 0.6",
   "parameters": {
    "operation": "greater_or_equal",
    "compare_number": 0.6
   },
   "position": {
    "x": 1600,
    "y": 120
   }
  },
  {
   "id": "faithful_studio",
   "type": "utility/boolean_combine",
   "label": "Studio packshot: still the same jacket",
   "parameters": {
    "mode": "all"
   },
   "position": {
    "x": 1900,
    "y": 0
   }
  },
  {
   "id": "release_studio",
   "type": "utility/filter",
   "label": "Studio packshot: publish only if faithful",
   "parameters": {
    "invert": false
   },
   "position": {
    "x": 2200,
    "y": 0
   }
  },
  {
   "id": "out_studio",
   "type": "output/image",
   "label": "Studio packshot to publish",
   "parameters": {
    "output_name": "studio_to_publish"
   },
   "position": {
    "x": 2500,
    "y": 0
   }
  },
  {
   "id": "out_all_studio",
   "type": "output/image",
   "label": "Studio packshot as generated",
   "parameters": {
    "output_name": "studio_generated"
   },
   "position": {
    "x": 640,
    "y": 220
   }
  },
  {
   "id": "shot_warm",
   "type": "ai/product_photography",
   "label": "Warm mood shot",
   "parameters": {
    "surface": "wood_walnut",
    "lighting": "golden_hour",
    "mood": "cozy",
    "angle": "front",
    "aspect_ratio": "4_5"
   },
   "position": {
    "x": 320,
    "y": 1000
   }
  },
  {
   "id": "cut_warm",
   "type": "ai/remove_background",
   "label": "Warm mood shot: jacket alone",
   "parameters": {},
   "position": {
    "x": 640,
    "y": 1000
   }
  },
  {
   "id": "tone_warm",
   "type": "image/statistics",
   "label": "Warm mood shot: tone and colour",
   "parameters": {},
   "position": {
    "x": 960,
    "y": 920
   }
  },
  {
   "id": "detail_warm",
   "type": "image/detail",
   "label": "Warm mood shot: texture",
   "parameters": {},
   "position": {
    "x": 960,
    "y": 1100
   }
  },
  {
   "id": "colour_warm",
   "type": "utility/calculate",
   "label": "Warm mood shot: colour shift",
   "parameters": {
    "expression": "abs(shot.global.oklab.mean_a - real.global.oklab.mean_a) + abs(shot.global.oklab.mean_b - real.global.oklab.mean_b)",
    "decimals": 4
   },
   "position": {
    "x": 1280,
    "y": 880
   }
  },
  {
   "id": "light_warm",
   "type": "utility/calculate",
   "label": "Warm mood shot: light change",
   "parameters": {
    "expression": "abs(shot.global.luma.p50 - real.global.luma.p50)",
    "decimals": 4
   },
   "position": {
    "x": 1280,
    "y": 1000
   }
  },
  {
   "id": "texture_warm",
   "type": "utility/calculate",
   "label": "Warm mood shot: texture kept",
   "parameters": {
    "expression": "shot.global.residual_mad_3 / real.global.residual_mad_3",
    "decimals": 3
   },
   "position": {
    "x": 1280,
    "y": 1120
   }
  },
  {
   "id": "colour_ok_warm",
   "type": "utility/predicate",
   "label": "Warm mood shot: colour shift at most 0.02",
   "parameters": {
    "operation": "less_or_equal",
    "compare_number": 0.02
   },
   "position": {
    "x": 1600,
    "y": 880
   }
  },
  {
   "id": "light_ok_warm",
   "type": "utility/predicate",
   "label": "Warm mood shot: light change at most 0.12",
   "parameters": {
    "operation": "less_or_equal",
    "compare_number": 0.12
   },
   "position": {
    "x": 1600,
    "y": 1000
   }
  },
  {
   "id": "texture_ok_warm",
   "type": "utility/predicate",
   "label": "Warm mood shot: texture kept at least 0.6",
   "parameters": {
    "operation": "greater_or_equal",
    "compare_number": 0.6
   },
   "position": {
    "x": 1600,
    "y": 1120
   }
  },
  {
   "id": "faithful_warm",
   "type": "utility/boolean_combine",
   "label": "Warm mood shot: still the same jacket",
   "parameters": {
    "mode": "all"
   },
   "position": {
    "x": 1900,
    "y": 1000
   }
  },
  {
   "id": "release_warm",
   "type": "utility/filter",
   "label": "Warm mood shot: publish only if faithful",
   "parameters": {
    "invert": false
   },
   "position": {
    "x": 2200,
    "y": 1000
   }
  },
  {
   "id": "out_warm",
   "type": "output/image",
   "label": "Warm mood shot to publish",
   "parameters": {
    "output_name": "warm_to_publish"
   },
   "position": {
    "x": 2500,
    "y": 1000
   }
  },
  {
   "id": "out_all_warm",
   "type": "output/image",
   "label": "Warm mood shot as generated",
   "parameters": {
    "output_name": "warm_generated"
   },
   "position": {
    "x": 640,
    "y": 1220
   }
  },
  {
   "id": "report",
   "type": "utility/json_compose",
   "label": "Report",
   "parameters": {
    "template": "{\n \"product\": \"the real jacket\",\n \"looks\": [\n  {\n   \"look\": \"studio\",\n   \"colour_shift\": \"{{colour_studio}}\",\n   \"light_change\": \"{{light_studio}}\",\n   \"texture_kept\": \"{{texture_studio}}\",\n   \"publish\": \"{{faithful_studio}}\"\n  },\n  {\n   \"look\": \"warm\",\n   \"colour_shift\": \"{{colour_warm}}\",\n   \"light_change\": \"{{light_warm}}\",\n   \"texture_kept\": \"{{texture_warm}}\",\n   \"publish\": \"{{faithful_warm}}\"\n  }\n ]\n}"
   },
   "position": {
    "x": 2200,
    "y": 500
   }
  },
  {
   "id": "out_report",
   "type": "output/json",
   "label": "Report",
   "parameters": {
    "output_name": "report"
   },
   "position": {
    "x": 2500,
    "y": 500
   }
  }
 ],
 "connections": [
  {
   "from_node": "product",
   "from_output": "image",
   "to_node": "cut_real",
   "to_input": "image"
  },
  {
   "from_node": "product",
   "from_output": "image",
   "to_node": "real_tone",
   "to_input": "image"
  },
  {
   "from_node": "cut_real",
   "from_output": "result",
   "to_node": "real_tone",
   "to_input": "mask"
  },
  {
   "from_node": "product",
   "from_output": "image",
   "to_node": "real_detail",
   "to_input": "image"
  },
  {
   "from_node": "cut_real",
   "from_output": "result",
   "to_node": "real_detail",
   "to_input": "mask"
  },
  {
   "from_node": "product",
   "from_output": "image",
   "to_node": "shot_studio",
   "to_input": "product_image"
  },
  {
   "from_node": "shot_studio",
   "from_output": "result",
   "to_node": "cut_studio",
   "to_input": "image"
  },
  {
   "from_node": "shot_studio",
   "from_output": "result",
   "to_node": "tone_studio",
   "to_input": "image"
  },
  {
   "from_node": "cut_studio",
   "from_output": "result",
   "to_node": "tone_studio",
   "to_input": "mask"
  },
  {
   "from_node": "shot_studio",
   "from_output": "result",
   "to_node": "detail_studio",
   "to_input": "image"
  },
  {
   "from_node": "cut_studio",
   "from_output": "result",
   "to_node": "detail_studio",
   "to_input": "mask"
  },
  {
   "from_node": "tone_studio",
   "from_output": "statistics",
   "to_node": "colour_studio",
   "to_input": "shot"
  },
  {
   "from_node": "real_tone",
   "from_output": "statistics",
   "to_node": "colour_studio",
   "to_input": "real"
  },
  {
   "from_node": "tone_studio",
   "from_output": "statistics",
   "to_node": "light_studio",
   "to_input": "shot"
  },
  {
   "from_node": "real_tone",
   "from_output": "statistics",
   "to_node": "light_studio",
   "to_input": "real"
  },
  {
   "from_node": "detail_studio",
   "from_output": "detail",
   "to_node": "texture_studio",
   "to_input": "shot"
  },
  {
   "from_node": "real_detail",
   "from_output": "detail",
   "to_node": "texture_studio",
   "to_input": "real"
  },
  {
   "from_node": "colour_studio",
   "from_output": "result",
   "to_node": "colour_ok_studio",
   "to_input": "a"
  },
  {
   "from_node": "light_studio",
   "from_output": "result",
   "to_node": "light_ok_studio",
   "to_input": "a"
  },
  {
   "from_node": "texture_studio",
   "from_output": "result",
   "to_node": "texture_ok_studio",
   "to_input": "a"
  },
  {
   "from_node": "colour_ok_studio",
   "from_output": "result",
   "to_node": "faithful_studio",
   "to_input": "conditions_0"
  },
  {
   "from_node": "light_ok_studio",
   "from_output": "result",
   "to_node": "faithful_studio",
   "to_input": "conditions_1"
  },
  {
   "from_node": "texture_ok_studio",
   "from_output": "result",
   "to_node": "faithful_studio",
   "to_input": "conditions_2"
  },
  {
   "from_node": "faithful_studio",
   "from_output": "result",
   "to_node": "release_studio",
   "to_input": "condition"
  },
  {
   "from_node": "shot_studio",
   "from_output": "result",
   "to_node": "release_studio",
   "to_input": "value"
  },
  {
   "from_node": "release_studio",
   "from_output": "value",
   "to_node": "out_studio",
   "to_input": "image"
  },
  {
   "from_node": "shot_studio",
   "from_output": "result",
   "to_node": "out_all_studio",
   "to_input": "image"
  },
  {
   "from_node": "product",
   "from_output": "image",
   "to_node": "shot_warm",
   "to_input": "product_image"
  },
  {
   "from_node": "shot_warm",
   "from_output": "result",
   "to_node": "cut_warm",
   "to_input": "image"
  },
  {
   "from_node": "shot_warm",
   "from_output": "result",
   "to_node": "tone_warm",
   "to_input": "image"
  },
  {
   "from_node": "cut_warm",
   "from_output": "result",
   "to_node": "tone_warm",
   "to_input": "mask"
  },
  {
   "from_node": "shot_warm",
   "from_output": "result",
   "to_node": "detail_warm",
   "to_input": "image"
  },
  {
   "from_node": "cut_warm",
   "from_output": "result",
   "to_node": "detail_warm",
   "to_input": "mask"
  },
  {
   "from_node": "tone_warm",
   "from_output": "statistics",
   "to_node": "colour_warm",
   "to_input": "shot"
  },
  {
   "from_node": "real_tone",
   "from_output": "statistics",
   "to_node": "colour_warm",
   "to_input": "real"
  },
  {
   "from_node": "tone_warm",
   "from_output": "statistics",
   "to_node": "light_warm",
   "to_input": "shot"
  },
  {
   "from_node": "real_tone",
   "from_output": "statistics",
   "to_node": "light_warm",
   "to_input": "real"
  },
  {
   "from_node": "detail_warm",
   "from_output": "detail",
   "to_node": "texture_warm",
   "to_input": "shot"
  },
  {
   "from_node": "real_detail",
   "from_output": "detail",
   "to_node": "texture_warm",
   "to_input": "real"
  },
  {
   "from_node": "colour_warm",
   "from_output": "result",
   "to_node": "colour_ok_warm",
   "to_input": "a"
  },
  {
   "from_node": "light_warm",
   "from_output": "result",
   "to_node": "light_ok_warm",
   "to_input": "a"
  },
  {
   "from_node": "texture_warm",
   "from_output": "result",
   "to_node": "texture_ok_warm",
   "to_input": "a"
  },
  {
   "from_node": "colour_ok_warm",
   "from_output": "result",
   "to_node": "faithful_warm",
   "to_input": "conditions_0"
  },
  {
   "from_node": "light_ok_warm",
   "from_output": "result",
   "to_node": "faithful_warm",
   "to_input": "conditions_1"
  },
  {
   "from_node": "texture_ok_warm",
   "from_output": "result",
   "to_node": "faithful_warm",
   "to_input": "conditions_2"
  },
  {
   "from_node": "faithful_warm",
   "from_output": "result",
   "to_node": "release_warm",
   "to_input": "condition"
  },
  {
   "from_node": "shot_warm",
   "from_output": "result",
   "to_node": "release_warm",
   "to_input": "value"
  },
  {
   "from_node": "release_warm",
   "from_output": "value",
   "to_node": "out_warm",
   "to_input": "image"
  },
  {
   "from_node": "shot_warm",
   "from_output": "result",
   "to_node": "out_all_warm",
   "to_input": "image"
  },
  {
   "from_node": "colour_studio",
   "from_output": "result",
   "to_node": "report",
   "to_input": "colour_studio"
  },
  {
   "from_node": "light_studio",
   "from_output": "result",
   "to_node": "report",
   "to_input": "light_studio"
  },
  {
   "from_node": "texture_studio",
   "from_output": "result",
   "to_node": "report",
   "to_input": "texture_studio"
  },
  {
   "from_node": "faithful_studio",
   "from_output": "result",
   "to_node": "report",
   "to_input": "faithful_studio"
  },
  {
   "from_node": "colour_warm",
   "from_output": "result",
   "to_node": "report",
   "to_input": "colour_warm"
  },
  {
   "from_node": "light_warm",
   "from_output": "result",
   "to_node": "report",
   "to_input": "light_warm"
  },
  {
   "from_node": "texture_warm",
   "from_output": "result",
   "to_node": "report",
   "to_input": "texture_warm"
  },
  {
   "from_node": "faithful_warm",
   "from_output": "result",
   "to_node": "report",
   "to_input": "faithful_warm"
  },
  {
   "from_node": "report",
   "from_output": "json",
   "to_node": "out_report",
   "to_input": "json"
  }
 ]
}
