{
 "v": 1,
 "lid": "restore-the-photo",
 "nid": 9,
 "nodes": [
  {
   "id": "note",
   "type": "comment",
   "name": "About this workflow",
   "x": 40,
   "y": 40,
   "fields": {
    "text": "RESTORE THE PHOTO \u2014 one damaged photograph in, a restored print and an audit out. A vision survey inventories the damage first (scratches, tears, stains, fading, dust), Seedream 5.5 repairs it under a hard no-inventions rule, a Pruna upscale brings back print size, and an identity guard then compares every face and object against your original and prints a repair ledger: what was repaired, what was rebuilt, what was left alone. About $0.04 a run. The guard is a check, not a guarantee \u2014 its first probe run let an invented necklace through; the prompts were hardened, and the guide tells you what to eyeball yourself."
   }
  },
  {
   "id": "photo",
   "type": "upload",
   "name": "Damaged photo",
   "x": 40,
   "y": 260,
   "fields": {}
  },
  {
   "id": "survey",
   "type": "vision",
   "name": "Damage survey",
   "x": 320,
   "y": 100,
   "fields": {
    "model": "google/gemini-3.1-flash-lite",
    "q": "Inventory every defect in this damaged photograph, one per line: overall fading or colour cast; scratches (where each runs); tears or missing areas; stains; creases; blurred areas; dust and specks. For the face, add a line 'FACE: damage: <what touches it, or none>'. End with 'FACES: <n>'."
   }
  },
  {
   "id": "restore",
   "type": "edit",
   "name": "Restore \u2014 Seedream 5.5",
   "x": 320,
   "y": 380,
   "fields": {
    "model": "bytedance/seedream-v5.5/edit",
    "size": "1k",
    "prompt": "Restore this photograph: repair the visible damage \u2014 scratches, tears, stains, creases, dust \u2014 recover the faded contrast, and remove the age tint. If the photograph is black-and-white, return a clean black-and-white print; if it has colour, recover the faded colour faithfully \u2014 do not colorize a monochrome original. Keep every face, pose, garment and background element identical to the original. Add NOTHING that is not in the original: no jewelry, no necklace, no earrings, no glasses, no hat, no watch, no new objects, no extra people. Do not beautify or modernize."
   }
  },
  {
   "id": "upscale",
   "type": "edit",
   "name": "Upscale \u2014 Pruna",
   "x": 600,
   "y": 380,
   "fields": {
    "model": "pruna-ai/p-image/upscale"
   }
  },
  {
   "id": "guard",
   "type": "llm",
   "name": "Identity guard + repair ledger",
   "x": 880,
   "y": 240,
   "fields": {
    "model": "google/gemini-3.1-flash-lite",
    "system": "You are the identity guard and bookkeeper for a photo restoration. Two images are attached: the FIRST is the damaged original, the SECOND is the restored result. The damage survey arrives as this message's text. Do three things. 1) IDENTITY: for every face in the result, say whether it is recognizably the same person as in the original \u2014 same features, same expression \u2014 and name any drift. 2) INVENTIONS \u2014 be adversarial: restoration models commonly invent jewelry, necklaces, earrings, glasses, hats, watches and background objects. Check the neck, ears, wrists and background of the result against the original item by item. Anything present in the result but absent in the original is an INVENTION, even if it looks natural. List every invention, or 'none' only if you verified each area. 3) REPAIR LEDGER: go through the attached survey ITEM BY ITEM \u2014 every defect the survey lists must appear in exactly one of three headed lists: REPAIRED (damage now gone), REBUILT (areas the restoration had to reconstruct), LEFT ALONE (damage still visible or deliberately untouched). Never call damage minor that the survey lists as a tear, a stain, or a missing area. End with exactly one verdict line: 'RESTORE: HELD' if identity held and nothing was invented, else 'RESTORE: DRIFTED'."
   }
  },
  {
   "id": "guide",
   "type": "llm",
   "name": "Guide \u2014 your restored photo",
   "x": 1160,
   "y": 240,
   "fields": {
    "model": "z-ai/glm-4.6",
    "system": "You write the guide for a workflow that restores one damaged photograph (Seedream 5.5 edit, then a Pruna upscale; about $0.04 a run). You are given an identity guard's report on the restoration: its repair ledger (keyed to a damage survey of the original) and its verdict. Write 150-200 words in three headed sections. WHAT WAS WRONG: the damage recorded in the ledger's repaired and rebuilt lists, in plain words. WHAT WAS DONE: what the ledger says was repaired and rebuilt, and the guard's verdict line, quoted exactly. THE HONEST EDGES: always include these three \u2014 (1) the identity guard is a check, not a guarantee: on this workflow's first probe run the restorer invented a necklace the guard initially passed; the prompts were hardened afterwards, but the user should still eyeball jewelry, hands and background themselves; (2) anything listed under REBUILT was reconstructed by the model \u2014 a badly missing area is an informed invention, not a recovery; (3) a black-and-white original stays black-and-white (this workflow does not colorize), and the upscale pass softens the original print grain slightly. Use only facts from the attached guard report; never invent damage, repairs, names or numbers. HARD RULE: if the attached guard report is missing, is a refusal or a request for uploads, or contains no line beginning 'RESTORE:', your entire output is exactly: 'The guard did not complete its check on this run \u2014 please re-run the workflow.' Never invent a ledger, damage, or repairs that are not in the attached report."
   }
  }
 ],
 "links": [
  {
   "id": "l1",
   "from": {
    "node": "photo",
    "port": "image"
   },
   "to": {
    "node": "survey",
    "port": "image"
   }
  },
  {
   "id": "l2",
   "from": {
    "node": "photo",
    "port": "image"
   },
   "to": {
    "node": "restore",
    "port": "image"
   }
  },
  {
   "id": "l3",
   "from": {
    "node": "restore",
    "port": "image"
   },
   "to": {
    "node": "upscale",
    "port": "image"
   }
  },
  {
   "id": "l4",
   "from": {
    "node": "photo",
    "port": "image"
   },
   "to": {
    "node": "guard",
    "port": "img"
   }
  },
  {
   "id": "l5",
   "from": {
    "node": "upscale",
    "port": "image"
   },
   "to": {
    "node": "guard",
    "port": "img2"
   }
  },
  {
   "id": "l6",
   "from": {
    "node": "survey",
    "port": "text"
   },
   "to": {
    "node": "guard",
    "port": "prompt"
   }
  },
  {
   "id": "l7",
   "from": {
    "node": "guard",
    "port": "text"
   },
   "to": {
    "node": "guide",
    "port": "prompt"
   }
  }
 ]
}