n8n

How to Generate Hugging Face to S3 Creative Assets?

Turn a written idea into a hosted image in minutes. A simple form collects a prompt and a visual style, then delivers a shareable image link. It helps marketing teams produce fast visuals for ads, social posts, and blogs without waiting on design cycles.

The form captures two fields and sends them into a router that picks a style preset. Each preset adds a detailed style prompt, such as Hyper Surreal Escape, Post Analog Glitchscape, AI Dystopia, Neon Fauvism, Vivid Pop Explosion, or None. The flow calls a Hugging Face text to image model and returns an image. The file uploads to an S3 bucket with a unique name, and a web page shows the result or returns a clear error if the model fails. You can also swap the model by changing the endpoint URL.

You only need a Hugging Face API token and an S3 compatible bucket like Amazon S3 or Cloudflare R2. After you save credentials in n8n, the pipeline turns prompts into ready to use images and removes manual uploads. Expect faster campaign drafts, quick variations, and easy product mockups with links you can share anywhere.

What are the key features?

  • Form Trigger collects the prompt and a chosen style from a simple web page
  • Switch node routes the request to a matching style track
  • Set nodes inject detailed style prompts for six presets including None
  • HTTP Request calls the Hugging Face model endpoint and returns a binary image
  • S3 node uploads the image with a unique name based on the execution id
  • Success path returns a styled HTML results page with the hosted image
  • Error path sends a clear message back if the model times out or fails

What are the benefits?

  • Reduce manual work from 30 minutes to 2 minutes per image
  • Automate 100% of image hosting and link sharing
  • Streamline creative requests by 70% with a self serve form
  • Connect Hugging Face and Amazon S3 seamlessly
  • Use consistent styles to cut revisions by 40%

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Hugging Face and Amazon S3. See the Tools Required section above for links to create accounts with these services.
  3. Create a Hugging Face API token in your Hugging Face account. In n8n, open the HTTP Request node for image generation, choose the 'Credential to connect with' dropdown, click 'Create new credential', pick HTTP Header Auth, and add header name Authorization with value Bearer YOUR_HF_TOKEN. Save the credential.
  4. Confirm the model endpoint in the HTTP Request node. Keep the default or paste another Hugging Face model path in the URL as needed.
  5. In the n8n credentials manager, create a new S3 credential. Add your Access Key ID, Secret Access Key, and Region. If using Cloudflare R2, set the custom endpoint to your R2 URL and use your R2 access keys.
  6. Open the S3 upload node and set your bucket name. Keep or adjust the file name pattern so each image is unique.
  7. Open the n8n Form Trigger and confirm two fields exist: Prompt to flux and Style. Make sure the Style options match the router paths.
  8. Open the Switch node and check that each case points to a matching Set node that builds the style prompt.
  9. Run the workflow once to activate the form. Copy the public form URL from the Form Trigger and submit a test prompt and style.
  10. After submission, the results page should display the hosted image. In your S3 console, verify the file was created in the correct bucket.
  11. If you see a message that the model failed, submit again. For a 401 or 403 error, recheck the Hugging Face token or bucket permissions. If the image does not load, confirm the object is public or that you are using a signed URL.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Amazon S3

Sign up

AWS Free Tier: 5 GB S3 Standard storage, 20,000 GET requests, 2,000 PUT/COPY/POST/LIST requests, and 100 GB data transfer out / mo

Hugging Face

Sign up

Free tier: $0 / mo, includes ~$0.10 in monthly Inference API credits; extra usage not available on Free

Credits:
Built by @maxtkacz as part of the 30 Day AI Sprint. Watch the tutorial: YouTube video. Project page: Notion page

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.