Generates an image for every brief in your sheet against your brand guidelines, files it in Box and links it back to the row.

UsesClaudeBoxGoogle SheetsStability AI

Turn a list of image briefs into on-brand images

ValuesSet spreadsheetUrl to blank.Set spreadsheetUrl to blank.
ValuesSet briefsTabName to Image briefs.Set briefsTabName to Image briefs.
ValuesSet brandGuidelines to blank.Set brandGuidelines to blank.
ValuesSet boxFolderId to blank.Set boxFolderId to blank.
ValuesSet aspectRatio to 16:9.Set aspectRatio to 16:9.
ValuesSet imageStyle to digital-art.Set imageStyle to digital-art.
ValuesSet maxImagesPerRun to 8.Set maxImagesPerRun to 8.
Google SheetsGoogle SheetsRead the rows of spreadsheetUrl. Save it as briefs.Read the rows of spreadsheetUrl. Save it as briefs.
ValuesSet headers to briefs.headers.Set headers to briefs.headers.
Decisions & LoopsIf the first item of headers is not Image linkIf the first item of headers is not Image link
Yes
Decisions & LoopsStop and report a problem: The first column of the 'Image briefs' tab has to be headed 'Image link' - that is the only cell this workflow ever writes to. Put 'Image link' in column A, 'Name' in column B and 'Brief' in column C, then run it again.Stop and report a problem: The first column of the 'Image briefs' tab has to be headed 'Image link' - that is the only cell this workflow ever writes to. Put 'Image link' in column A, 'Name' in column B and 'Brief' in column C, then run it again.
No
No steps
Decisions & LoopsIf headers doesn't contain NameIf headers doesn't contain Name
Yes
Decisions & LoopsStop and report a problem: Your briefs tab needs a 'Name' column holding a short name for each image - it becomes the file name in Box. Add it and run it again.Stop and report a problem: Your briefs tab needs a 'Name' column holding a short name for each image - it becomes the file name in Box. Add it and run it again.
No
No steps
Decisions & LoopsIf headers doesn't contain BriefIf headers doesn't contain Brief
Yes
Decisions & LoopsStop and report a problem: Your briefs tab needs a 'Brief' column saying what each image should show. Add it and run it again.Stop and report a problem: Your briefs tab needs a 'Brief' column saying what each image should show. Add it and run it again.
No
No steps
ValuesSet rows to briefs.rows.Set rows to briefs.rows.
ValuesSet generatedCount to 0.Set generatedCount to 0.
ValuesSet skippedBriefs to an empty list.Set skippedBriefs to an empty list.
MathSet imageBudget to maxImagesPerRun multiplied by 1.Set imageBudget to maxImagesPerRun multiplied by 1.
Decisions & LoopsFor each briefRow in rows:For each briefRow in rows:
ValuesSet rowLabel to row briefRow.row_number as text.Set rowLabel to row briefRow.row_number as text.
ValuesSet briefName to blank.Set briefName to blank.
ValuesSet briefText to blank.Set briefText to blank.
ValuesSet existingLink to blank.Set existingLink to blank.
Decisions & LoopsIf a step below fails, save the error as columnErrorIf a step below fails, save the error as columnError
Try
TextTrim briefRow.Name and save it as briefName.Trim briefRow.Name and save it as briefName.
TextTrim briefRow.Brief and save it as briefText.Trim briefRow.Brief and save it as briefText.
TextTrim briefRow["Image link"] and save it as existingLink.Trim briefRow["Image link"] and save it as existingLink.
On error
ListsAdd rowLabel to the end of skippedBriefs and save it as skippedBriefs.Add rowLabel to the end of skippedBriefs and save it as skippedBriefs.
ValuesShow in the output: Skipped rowLabel - it is missing one of the 'Image link', 'Name' or 'Brief' columns.Show in the output: Skipped rowLabel - it is missing one of the 'Image link', 'Name' or 'Brief' columns.
Decisions & LoopsSkip to the next item.Skip to the next item.
Decisions & LoopsIf existingLink isn't emptyIf existingLink isn't empty
Yes
Decisions & LoopsSkip to the next item.Skip to the next item.
No
No steps
Decisions & LoopsIf briefText is emptyIf briefText is empty
Yes
ListsAdd rowLabel to the end of skippedBriefs and save it as skippedBriefs.Add rowLabel to the end of skippedBriefs and save it as skippedBriefs.
ValuesShow in the output: Skipped rowLabel - its 'Brief' column is empty.Show in the output: Skipped rowLabel - its 'Brief' column is empty.
Decisions & LoopsSkip to the next item.Skip to the next item.
No
No steps
Decisions & LoopsIf briefName is emptyIf briefName is empty
Yes
ListsAdd rowLabel to the end of skippedBriefs and save it as skippedBriefs.Add rowLabel to the end of skippedBriefs and save it as skippedBriefs.
ValuesShow in the output: Skipped rowLabel - its 'Name' column is empty, and the name is what the image is filed under.Show in the output: Skipped rowLabel - its 'Name' column is empty, and the name is what the image is filed under.
Decisions & LoopsSkip to the next item.Skip to the next item.
No
No steps
Decisions & LoopsIf generatedCount is greater than or equal to imageBudgetIf generatedCount is greater than or equal to imageBudget
Yes
ValuesShow in the output: Stopped at this run's limit of imageBudget as text image(s). Run it again to carry on from where it left off.Show in the output: Stopped at this run's limit of imageBudget as text image(s). Run it again to carry on from where it left off.
Decisions & LoopsStop repeating.Stop repeating.
No
No steps
ValuesSet brandSection to Brand guidelines:Set brandSection to Brand guidelines: brandGuidelines.
ValuesSet briefSection to Image brief:Set briefSection to Image brief: briefText.
ValuesSet writerPrompt to You are writing the prompt for an image generator.Set writerPrompt to You are writing the prompt for an image generator. Turn the image brief below into ONE vivid prompt of at most 60 words describing the finished picture: subject, composition, colour, lighting and mood. Apply the brand guidelines to all of it, so every image reads as the same brand. Rules: - Reply with the prompt only. No preamble, no quotation marks, no explanation. - Describe a scene, an object or an abstract composition. Never a real, identifiable person. - If the brief names or describes a real person - a public figure, a customer, a colleague, anyone identifiable - reply with exactly CANNOT ILLUSTRATE and nothing else. - Never put a personal name into the prompt. - Do not ask for words, logos or lettering in the picture; image generators render text badly. brandSection.
ValuesChange writerPrompt to writerPromptChange writerPrompt to writerPrompt briefSection.
ValuesSet imagePrompt to blank.Set imagePrompt to blank.
Decisions & LoopsIf a step below fails, save the error as writerErrorIf a step below fails, save the error as writerError
Try
ClaudeClaudeAsk Claude: writerPrompt. Save it as written.Ask Claude: writerPrompt. Save it as written. Maximum response length: 400
TextTrim written.response_text and save it as imagePrompt.Trim written.response_text and save it as imagePrompt.
On error
ListsAdd rowLabel to the end of skippedBriefs and save it as skippedBriefs.Add rowLabel to the end of skippedBriefs and save it as skippedBriefs.
ValuesShow in the output: Could not write an image prompt for rowLabel: writerError as text.Show in the output: Could not write an image prompt for rowLabel: writerError as text.
Decisions & LoopsSkip to the next item.Skip to the next item.
Decisions & LoopsIf imagePrompt contains CANNOT ILLUSTRATEIf imagePrompt contains CANNOT ILLUSTRATE
Yes
ListsAdd rowLabel to the end of skippedBriefs and save it as skippedBriefs.Add rowLabel to the end of skippedBriefs and save it as skippedBriefs.
ValuesShow in the output: Skipped rowLabel - the brief describes a real person, and this workflow does not generate pictures of real people.Show in the output: Skipped rowLabel - the brief describes a real person, and this workflow does not generate pictures of real people.
Decisions & LoopsSkip to the next item.Skip to the next item.
No
No steps
Decisions & LoopsIf imagePrompt is emptyIf imagePrompt is empty
Yes
ListsAdd rowLabel to the end of skippedBriefs and save it as skippedBriefs.Add rowLabel to the end of skippedBriefs and save it as skippedBriefs.
ValuesShow in the output: Skipped rowLabel - no image prompt came back for it.Show in the output: Skipped rowLabel - no image prompt came back for it.
Decisions & LoopsSkip to the next item.Skip to the next item.
No
No steps
TextReplace \ with - in briefName with / replaced by - and save it as safeName.Replace \ with - in briefName with / replaced by - and save it as safeName.
ValuesSet fileName to safeName.png.Set fileName to safeName.png.
ValuesSet imageRef to blank.Set imageRef to blank.
Decisions & LoopsIf a step below fails, save the error as imageErrorIf a step below fails, save the error as imageError
Try
Stability AIStability AIGenerate an image of imagePrompt. Save it as generated.Generate an image of imagePrompt. Save it as generated.real people, recognisable faces, portraits of identifiable individuals, celebrities, public figures, logos, watermarks, lettering, text
TextTrim generated.document_ref and save it as imageRef.Trim generated.document_ref and save it as imageRef.
On error
ListsAdd rowLabel to the end of skippedBriefs and save it as skippedBriefs.Add rowLabel to the end of skippedBriefs and save it as skippedBriefs.
ValuesShow in the output: Could not generate the image for rowLabel: imageError as text.Show in the output: Could not generate the image for rowLabel: imageError as text.
Decisions & LoopsSkip to the next item.Skip to the next item.
ValuesSet imageLink to blank.Set imageLink to blank.
Decisions & LoopsIf a step below fails, save the error as uploadErrorIf a step below fails, save the error as uploadError
Try
BoxBoxUpload boxFolderId to Box folder imageRef. Save it as filed.Upload boxFolderId to Box folder imageRef. Save it as filed.
TextTrim filed.file_link and save it as imageLink.Trim filed.file_link and save it as imageLink.
On error
ListsAdd rowLabel to the end of skippedBriefs and save it as skippedBriefs.Add rowLabel to the end of skippedBriefs and save it as skippedBriefs.
ValuesShow in the output: Generated the image for rowLabel but could not file it in Box: uploadError as text.Show in the output: Generated the image for rowLabel but could not file it in Box: uploadError as text.
Decisions & LoopsSkip to the next item.Skip to the next item.
Decisions & LoopsIf imageLink is emptyIf imageLink is empty
Yes
ListsAdd rowLabel to the end of skippedBriefs and save it as skippedBriefs.Add rowLabel to the end of skippedBriefs and save it as skippedBriefs.
ValuesShow in the output: Filed the image for rowLabel but Box did not return a link to it.Show in the output: Filed the image for rowLabel but Box did not return a link to it.
Decisions & LoopsSkip to the next item.Skip to the next item.
No
No steps
Decisions & LoopsIf a step below fails, save the error as writeBackErrorIf a step below fails, save the error as writeBackError
Try
Google SheetsGoogle SheetsOverwrite row briefRow of briefsTabName in spreadsheetUrl.Overwrite row briefRow of briefsTabName in spreadsheetUrl.
On error
ValuesShow in the output: The image for rowLabel is in Box at imageLink but the link could not be written back to the sheet, so it will be generated again next run unless you paste it in.Show in the output: The image for rowLabel is in Box at imageLink but the link could not be written back to the sheet, so it will be generated again next run unless you paste it in.
ValuesAdd 1 to generatedCount.Add 1 to generatedCount.
ValuesSet doneMessage to Filed '@fileName' in Box for .Set doneMessage to Filed '@fileName' in Box for .
ValuesChange doneMessage to doneMessage@rowLabel: .Change doneMessage to doneMessage@rowLabel: .
ValuesShow in the output: doneMessage plus imageLink.Show in the output: doneMessage plus imageLink.
ValuesShow in the output: Finished. Generated and filed generatedCount as text image(s).Show in the output: Finished. Generated and filed generatedCount as text image(s).
Decisions & LoopsIf skippedBriefs isn't emptyIf skippedBriefs isn't empty
Yes
ValuesShow in the output: No image was generated for: skippedBriefs joined by , .Show in the output: No image was generated for: skippedBriefs joined by , .
No
No steps