Teale: Restore an old photo Instructions for an AI agent that hands in this task for its person. Free right now. We run these jobs on our own machines, so during this promotion there is nothing to pay. Page for people: https://teale.com/restore-old-photo/ All tasks: https://teale.com/agents/index.txt Same facts, JSON: https://teale.com/agents/tasks.json WHAT IT DOES Scratches, dust, tears and fading cleaned up, faces left as they are, with a repainted version to compare. What comes back: The restored picture, in the same shape as the original. When it has faces, also a second version with the faces repainted. WHAT IT DOES NOT DO - In the version with the faces kept, larger damage that lies on a face stays. - A repainted face can stop looking like the person. That is why the first version leaves faces alone, and why you get both versions. - Restored pictures can come out a little darker and more neutral in tone than a sepia original. - One photo per job. - You get a file, not a print. WHAT TO SEND - task: restore-old-photo - file: one file. JPEG, PNG, WebP or HEIC, up to 25 MB. The kind is read from the file's first bytes, not its name. - instruction: your person's request in one sentence, at most 1,000 characters. For example: Fix the scratches and the fading. - email (optional): only used to reach your person about this file. - src: task-txt, the word of this page (it tells us where you read the call; leave it out if you like). THE CALLS 1. Hand in the job. Run it in the folder that holds file.jpg, and put your person's request in instruction: curl -s -F task=restore-old-photo -F src=task-txt -F "instruction=Fix the scratches and the fading." -F "file=@file.jpg" https://tailor96s-mac-studio.tail3e51ae.ts.net/dp/agent/jobs The answer (201) holds job_id, state (received), position, free (true), price, job_url, status_url and next. The job has started: tell your person it is free and in line. They can watch it on job_url. 2. Ask for the state every 15 seconds until it is done, needs_info or failed (status_url from the answer is the same address): JOB_ID=paste-the-job_id-here curl -s "https://tailor96s-mac-studio.tail3e51ae.ts.net/dp/jobs/$JOB_ID" 3. When the state is done, fetch each file listed in results (n is 1, 2, ...; the url of each entry is the same address). curl saves it under its own name (teale-restore-old-photo-1 with its own ending) and saves nothing when it is not ready: curl -s -f -O -J "https://tailor96s-mac-studio.tail3e51ae.ts.net/dp/jobs/$JOB_ID/result/1" 4. Optional: tell us how it went. Only for a job that is done; the first answer of each field stands. It helps us make these jobs better and changes nothing for this one. feedback_url in the state answer is the same address: curl -s -X POST -d '{"got": "yes"}' "https://tailor96s-mac-studio.tail3e51ae.ts.net/dp/jobs/$JOB_ID/feedback" got: yes, partly or no. With partly or no you may add why: wrong (something in it is wrong), missing (something is missing), quality (the quality), not_asked (not what was asked), slow (too slow), other (something else). For example {"got": "partly", "why": "missing"}. The answer is 204 with no body. STATES, AND WHAT TO TELL YOUR PERSON - received: The job has started and is in line; position is how many jobs are ahead of it (0: it is next). Tell your person it is in line. When retry is there ({"try": 2, "of": 3}), the machines were busy and the job is tried again by itself (try 2 of 3): tell your person it takes a few minutes longer, and hand in nothing new. - working: The job runs. Tell your person it is being worked on. - done: results lists the finished files. Fetch each one and hand it to your person. feedback_url is where you can tell us how it went (optional). - needs_info: We need more to do it; message says what. Tell your person, and hand in a new job with a clearer request or another file. - failed: We could not do it; message says why. Tell your person why. Typical time for this task: 4 min 17 s of work once the job starts (median of 8 test runs). When other jobs are ahead of yours, position says how many. The time limit of one job is 25 minutes. PRICE Regular price: ~~$5~~ Free during the promotion. Price: free during the promotion. There is no pay step and no pay link: the job starts when you hand it in. Tell your person it is free. When the promotion ends, this page will say how paying works. Nothing of that is built. FAIR USE Every job is real work on our own machines, so these limits give everyone a turn. "From you" counts the address your calls come from. Each limit answers with its code: - At most 2 jobs from you in line or working at the same time: busy_source (429). Tell your person the next job goes in once one of the two has finished. Wait until one is done, needs_info or failed, then hand in the next. - At most 3 jobs from you an hour: limit_source (429). Tell your person it can go in a little later, and try again in an hour. - At most 10 jobs from you a day (a UTC day): limit_day_source (429). Tell your person that is today's limit of 10 free jobs, and hand the job in tomorrow. - At most 300 free jobs a day over all (a UTC day): limit_day (429). Tell your person today's free jobs are used up, and hand the job in tomorrow. REFUSALS Every refusal is JSON: {"ok": false, "error": "", "message": ""}. The fair-use codes are above; the others: - bad_form (400): the form could not be read: send multipart/form-data with task, instruction and file. - bad_task (400): task is not one of ours: use a slug from the list of tasks. - no_instruction (400): instruction is empty: put your person's request in one sentence. - instruction_too_long (400): instruction is over 1,000 characters. - bad_email (400): email does not look like an address: fix it or leave it out. - no_file (400): no file came with the form. - too_many (400): more files than this task takes. - too_big (413): a file is over 25 MB. - body_too_big (413): the whole form is more than we take at once (3 files of 25 MB). - wrong_type (415): a file is not a kind this task takes (read from its first bytes, not its name). - origin (403): you sent a web page's Origin header: call without one. - busy_hour (429): too many jobs this hour over all: try again in an hour. - queue_full (503): the line is full: try again in a little while. - storage_full (503): our storage is full: try again in a little while. - busy_uploads (503): too many uploads at once: try again in a minute. - timeout (408): the upload took too long: try again. - store_failed (500): something went wrong on our side: try again in a few minutes. - not_found (404): no such job: a wrong id, or a job past its 7 days. - not_ready (409): you asked for a file before the state was done: keep asking for the state. A refusal that comes before an upload is read (an Origin, a limit, a form over the size cap) can end the connection while curl is still sending a large file. If curl reports a broken connection, wait a minute and try once more. HOW LONG FILES ARE KEPT Files and results are deleted 7 days after the job was handed in. The job_id is the only key to the job and its files: keep it between you and your person, never post it. NEVER SEND Passwords, card numbers, bank logins or any other secret, in a file, the instruction or the email. We never ask for them.