{
  "author": {
    "address": "0x8031Db61A225F7ACB669FADb9102B6938aEF8AaF",
    "signature": "17d5be1567e67040e236d5a193bacfc89158847874da2abdd93fa05b05b2a5930838d0ae235f83406dd41c193212e93ff017b3851bf0d55325118460b68e2e8c1c"
  },
  "available_to_orchestrator": true,
  "changelog": "Faster defaults (one Modern office look at Quick quality), shows your original photo with the results, adds a \"Notes for this run\" field, and removes duplicate headshot file entries that showed a warning.",
  "content_hash": "sha256:44e282061eba15fc36f61dab97f7422aa72ea9a2e0be01197587b2f9596990ad",
  "created_at": "2026-11-12T09:43:52Z",
  "format": "osaurus.template",
  "format_version": 3,
  "id": "3A739ED5-6CC8-449F-AB3E-D2E6259542DD",
  "kind": "workflow",
  "name": "LinkedIn Headshot Studio",
  "requirements": {
    "knowledge": [],
    "mcp_servers": [],
    "media_models": [
      {
        "action": "edit",
        "model": {
          "family": "qwen-image-2.1",
          "locality": "local"
        }
      }
    ],
    "models": [],
    "network": [],
    "notes": {},
    "permissions": [],
    "plugins": [],
    "secrets": [],
    "tools": [
      "file_copy"
    ]
  },
  "summary": "Privately turn a casual photo of you into polished, professional LinkedIn headshots. Everything runs on your Mac with Qwen-Image 2.1, so your photo never leaves your Mac or goes to the cloud. The default (one Modern office look at Quick quality) takes about 1.5 minutes; more looks and higher quality take longer.",
  "version": 7,
  "workflow": {
    "edges": [
      {
        "from": "make_headshots",
        "to": "collect"
      },
      {
        "from": "plan_looks",
        "to": "bring_photo"
      },
      {
        "from": "bring_photo",
        "to": "make_headshots"
      }
    ],
    "examples": [
      {
        "input": {
          "attire": "Business suit",
          "photo": "~/Downloads/tytus headshot.jpg"
        },
        "name": "Business suit headshot"
      },
      {
        "input": {
          "attire": "Smart casual (blazer, open collar)",
          "look_count": 1,
          "photo": "~/Downloads/tytus headshot.jpg",
          "quality": "Quick",
          "shape": "Portrait (4:5)"
        },
        "name": "Quick portrait, one look"
      },
      {
        "input": {
          "attire": "Keep my current outfit",
          "look_count": 2,
          "notes": "warmer smile",
          "photo": "~/Downloads/tytus headshot.jpg",
          "quality": "Quick",
          "shape": "Square (LinkedIn)"
        },
        "name": "Own outfit with a note, two looks"
      },
      {
        "input": {
          "photo": "~/Downloads/tytus headshot.jpg",
          "run_notes": "Test photo from Unsplash."
        },
        "name": "Default settings with a credit"
      }
    ],
    "input_schema": {
      "additionalProperties": false,
      "properties": {
        "attire": {
          "default": "Smart casual (blazer, open collar)",
          "description": "What you'd like to be wearing in the headshots.",
          "enum": [
            "Keep my current outfit",
            "Business suit",
            "Smart casual (blazer, open collar)",
            "Casual professional (knit or shirt)"
          ],
          "title": "Outfit",
          "type": "string"
        },
        "look_count": {
          "default": 1,
          "description": "How many styles to make (1 to 4), in this order: modern office, studio grey, outdoor, charcoal executive.",
          "maximum": 4,
          "minimum": 1,
          "title": "Number of looks",
          "type": "integer"
        },
        "notes": {
          "description": "Changes to the picture, e.g. 'navy blazer', 'keep my glasses', 'warmer smile'.",
          "title": "Extra touches (optional)",
          "type": "string"
        },
        "photo": {
          "description": "A clear, front-facing photo of your face and shoulders (good light helps).",
          "format": "file",
          "title": "Your photo",
          "type": "string"
        },
        "quality": {
          "default": "Quick",
          "description": "Quick is about 1.5 min per headshot, Standard about 3, Best about 5.",
          "enum": [
            "Quick",
            "Standard",
            "Best"
          ],
          "title": "Quality",
          "type": "string"
        },
        "run_notes": {
          "description": "Not used to make the picture. Shown with the results: photo credits, or what you're trying this time.",
          "title": "Notes for this run (optional)",
          "type": "string"
        },
        "shape": {
          "default": "Square (LinkedIn)",
          "description": "Square suits LinkedIn; portrait (4:5) suits other profile sites and CVs.",
          "enum": [
            "Square (LinkedIn)",
            "Portrait (4:5)"
          ],
          "title": "Shape",
          "type": "string"
        }
      },
      "required": [
        "photo"
      ],
      "type": "object",
      "x-order": [
        "photo",
        "attire",
        "notes",
        "quality",
        "look_count",
        "shape",
        "run_notes"
      ]
    },
    "model_slots": [],
    "nodes": [
      {
        "code": {
          "network": [],
          "secrets": [],
          "source": "async function run(input, ctx) {\n  const attireMap = {\n    'Keep my current outfit': 'keep the same clothing as in the photo, neatened and wrinkle-free',\n    'Business suit': 'wearing a well-tailored dark business suit with a crisp shirt',\n    'Smart casual (blazer, open collar)': 'wearing a smart tailored blazer over an open-collar shirt',\n    'Casual professional (knit or shirt)': 'wearing a neat, well-fitted knit sweater or button-up shirt'\n  };\n  const attire = attireMap[input.attire] || attireMap['Smart casual (blazer, open collar)'];\n  const notes = (input.notes || '').trim();\n  const portrait = input.shape === 'Portrait (4:5)';\n  const framing = portrait ? 'Head-and-shoulders portrait framing with a little room above the head' : 'Head-and-shoulders framing, centred';\n  const base = 'Transform this photo into a high-end professional LinkedIn headshot of the same person. Preserve their exact face, identity, facial features, skin tone, hairstyle, age and expression; do not change who they are. ' + framing + ', looking at the camera with a confident, friendly expression. ' + attire + '. Sharp focus on the eyes, natural skin texture, shot on a full-frame camera with an 85mm portrait lens, photorealistic.' + (notes ? ' Also: ' + notes + '.' : '');\n  const all = [\n    { name: 'Modern office', scene: 'Bright modern office background softly blurred (shallow depth of field, bokeh), natural window light from the side.' },\n    { name: 'Studio grey', scene: 'Clean seamless light-grey studio backdrop, soft even key light with gentle fill, classic corporate portrait.' },\n    { name: 'Outdoor natural light', scene: 'Outdoors in soft late-afternoon natural light, softly blurred green and city background, warm and approachable.' },\n    { name: 'Charcoal executive', scene: 'Dark charcoal studio backdrop with subtle gradient, dramatic but flattering Rembrandt lighting, executive portrait.' }\n  ];\n  let n = parseInt(input.look_count, 10);\n  if (!(n >= 1)) n = 1;\n  n = Math.min(4, n);\n  const stepsMap = { 'Quick': 15, 'Standard': 30, 'Best': 50 };\n  const src = String(input.photo || '');\n  const m = src.match(/\\.([A-Za-z0-9]{2,5})$/);\n  const ext = m ? m[1].toLowerCase() : 'jpg';\n  return {\n    looks: all.slice(0, n).map(l => ({ name: l.name, prompt: base + ' ' + l.scene })),\n    steps: stepsMap[input.quality] || 15,\n    width: portrait ? 896 : 1024,\n    height: portrait ? 1120 : 1024,\n    model_family: 'qwen-image-2.1',\n    photo_name: 'source-photo.' + ext\n  };\n}",
          "timeout": 30
        },
        "id": "plan_looks",
        "input": {
          "attire": "{{input.attire}}",
          "look_count": "{{input.look_count}}",
          "notes": "{{input.notes}}",
          "photo": "{{input.photo}}",
          "quality": "{{input.quality}}",
          "shape": "{{input.shape}}"
        },
        "kind": "code",
        "name": "Choose the looks",
        "output_schema": {
          "properties": {
            "height": {
              "type": "integer"
            },
            "looks": {
              "items": {
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "prompt": {
                    "type": "string"
                  }
                },
                "required": [
                  "name",
                  "prompt"
                ],
                "type": "object"
              },
              "type": "array"
            },
            "model_family": {
              "type": "string"
            },
            "photo_name": {
              "type": "string"
            },
            "steps": {
              "type": "integer"
            },
            "width": {
              "type": "integer"
            }
          },
          "required": [
            "looks",
            "steps",
            "width",
            "height",
            "model_family",
            "photo_name"
          ],
          "type": "object"
        },
        "retry": {
          "backoff_seconds": 1,
          "max_attempts": 1
        },
        "timeout": 120
      },
      {
        "id": "make_headshots",
        "input": {},
        "kind": "map",
        "map": {
          "concurrency": 1,
          "items": "{{nodes.plan_looks.output.looks}}",
          "on_item_error": "skip",
          "step": {
            "input": {},
            "kind": "media",
            "media": {
              "action": "edit",
              "format": "png",
              "height": "{{nodes.plan_looks.output.height}}",
              "model": {
                "family": "qwen-image-2.1",
                "locality": "local"
              },
              "prompt": "{{item.prompt}} Keep it photorealistic and natural: no change to the person's identity or facial features, no distortion, no cartoon or painted look, no plastic-smooth skin, no text, watermark or logo.",
              "seed_mode": "random",
              "sources": [
                "{{nodes.bring_photo.output.destination}}"
              ],
              "steps": "{{nodes.plan_looks.output.steps}}",
              "width": "{{nodes.plan_looks.output.width}}"
            },
            "name": "Headshot",
            "output_schema": {},
            "timeout": 1800
          }
        },
        "name": "Make the headshots",
        "output_schema": {},
        "retry": {
          "backoff_seconds": 1,
          "max_attempts": 1
        },
        "timeout": 3600
      },
      {
        "code": {
          "network": [],
          "secrets": [],
          "source": "async function run(input, ctx) {\n  const headshots = [], looks = [];\n  (input.results || []).forEach((r, i) => {\n    const img = r && r.images && r.images[0];\n    if (img && img.path) { headshots.push(img.path); looks.push(input.looks[i].name); }\n  });\n  const failed = input.failed || [];\n  failed.forEach(f => ctx.log('Look ' + ((f.index || 0) + 1) + ' failed: ' + (f.error && f.error.message ? f.error.message : f.error)));\n  if (!headshots.length) {\n    const reasons = [...new Set(failed.map(f => (f.error && f.error.message) ? f.error.message : String(f.error || '')).filter(Boolean))];\n    throw new Error('No headshots were produced' + (reasons.length ? ': ' + reasons.join('; ') : '. Try a clearer, front-facing photo.'));\n  }\n  return { headshots, looks, notes: String(input.run_notes || '').trim() };\n}",
          "timeout": 30
        },
        "id": "collect",
        "input": {
          "failed": "{{nodes.make_headshots.output.failed}}",
          "looks": "{{nodes.plan_looks.output.looks}}",
          "results": "{{nodes.make_headshots.output.items}}",
          "run_notes": "{{input.run_notes}}"
        },
        "kind": "code",
        "name": "Gather the results",
        "output_schema": {
          "properties": {
            "headshots": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "looks": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "notes": {
              "type": "string"
            }
          },
          "required": [
            "headshots",
            "looks",
            "notes"
          ],
          "type": "object"
        },
        "retry": {
          "backoff_seconds": 1,
          "max_attempts": 1
        },
        "timeout": 120
      },
      {
        "id": "bring_photo",
        "input": {
          "destination": "{{run.workspace}}/in/{{nodes.plan_looks.output.photo_name}}",
          "overwrite": true,
          "source": "{{input.photo}}"
        },
        "intent": "Copy the chosen photo into the run's folder so the image model can read it",
        "kind": "tool",
        "name": "Bring in your photo",
        "output_schema": {},
        "retry": {
          "backoff_seconds": 1,
          "max_attempts": 1
        },
        "timeout": 900,
        "tool": {
          "name": "file_copy"
        }
      }
    ],
    "output": {
      "headshots": "{{nodes.collect.output.headshots}}",
      "looks": "{{nodes.collect.output.looks}}",
      "notes": "{{nodes.collect.output.notes}}",
      "source_photo": "{{nodes.bring_photo.output.destination}}"
    },
    "output_schema": {
      "additionalProperties": false,
      "properties": {
        "headshots": {
          "items": {
            "type": "string"
          },
          "title": "Headshots",
          "type": "array"
        },
        "looks": {
          "items": {
            "type": "string"
          },
          "title": "Looks made",
          "type": "array"
        },
        "notes": {
          "title": "Notes for this run",
          "type": "string"
        },
        "source_photo": {
          "format": "file",
          "title": "Your original photo",
          "type": "string"
        }
      },
      "required": [
        "source_photo",
        "headshots",
        "looks",
        "notes"
      ],
      "type": "object"
    },
    "requirement_notes": {},
    "secrets": []
  }
}