HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
adamkdean
gpt-unicorn
JavaScript2023–2023
adamkdean / gpt-unicorn · Archived

gpt-unicorn

Getting GPT-4 to draw a new unicorn every day

9Distinct people
10Mentions
0Explicit recommenders
80GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Getting GPT-4 to draw a new unicorn every day

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 5:04:57 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by week10 dated mentions

Observed mentions: 2023-04-13 21:14:03 UTC to 2023-08-10 17:24:44 UTC. Weeks start Monday, UTC.

02462023-04-10 00:00:00 UTC to 2023-04-17 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 commentsApr 102023-04-17 00:00:00 UTC to 2023-04-24 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-04-24 00:00:00 UTC to 2023-05-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-05-01 00:00:00 UTC to 2023-05-08 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-05-08 00:00:00 UTC to 2023-05-15 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-05-15 00:00:00 UTC to 2023-05-22 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-05-22 00:00:00 UTC to 2023-05-29 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-05-29 00:00:00 UTC to 2023-06-05 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-06-05 00:00:00 UTC to 2023-06-12 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsJun 52023-06-12 00:00:00 UTC to 2023-06-19 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-06-19 00:00:00 UTC to 2023-06-26 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-06-26 00:00:00 UTC to 2023-07-03 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-07-03 00:00:00 UTC to 2023-07-10 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-07-10 00:00:00 UTC to 2023-07-17 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-07-17 00:00:00 UTC to 2023-07-24 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-07-24 00:00:00 UTC to 2023-07-31 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-07-31 00:00:00 UTC to 2023-08-07 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-08-07 00:00:00 UTC to 2023-08-14 00:00:00 UTC (exclusive): 6 mentions; 0 submissions, 6 commentsAug 7

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Apr 102023-04-10 00:00:00 UTC2023-04-17 00:00:00 UTC404
Apr 172023-04-17 00:00:00 UTC2023-04-24 00:00:00 UTC000
Apr 242023-04-24 00:00:00 UTC2023-05-01 00:00:00 UTC000
May 12023-05-01 00:00:00 UTC2023-05-08 00:00:00 UTC000
May 82023-05-08 00:00:00 UTC2023-05-15 00:00:00 UTC000
May 152023-05-15 00:00:00 UTC2023-05-22 00:00:00 UTC000
May 222023-05-22 00:00:00 UTC2023-05-29 00:00:00 UTC000
May 292023-05-29 00:00:00 UTC2023-06-05 00:00:00 UTC000
Jun 52023-06-05 00:00:00 UTC2023-06-12 00:00:00 UTC000
Jun 122023-06-12 00:00:00 UTC2023-06-19 00:00:00 UTC000
Jun 192023-06-19 00:00:00 UTC2023-06-26 00:00:00 UTC000
Jun 262023-06-26 00:00:00 UTC2023-07-03 00:00:00 UTC000
Jul 32023-07-03 00:00:00 UTC2023-07-10 00:00:00 UTC000
Jul 102023-07-10 00:00:00 UTC2023-07-17 00:00:00 UTC000
Jul 172023-07-17 00:00:00 UTC2023-07-24 00:00:00 UTC000
Jul 242023-07-24 00:00:00 UTC2023-07-31 00:00:00 UTC000
Jul 312023-07-31 00:00:00 UTC2023-08-07 00:00:00 UTC000
Aug 72023-08-07 00:00:00 UTC2023-08-14 00:00:00 UTC606

What Hacker News says

10 sources
The prompt is Draw a unicorn in SVG format. Dimensions: 500x500. Respond ONLY with a single SVG string. Do not respond with conversation or codeblocks. https://github.com/adamkdean/gpt-unicorn/blob/master/src/lib... I just asked this and got the following result: <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="500" height="500" viewBox="0 0 500 500"> <path fill="#FDD7E4" d="M244.898 309.347c-.355-.421-5.388-6.485-5.388-10.305v-40.614l-3.073-12.759c-.708-2.684-2.527-4.924-5.034-6.38l-24.773-14.334c-8.152-4.72-15.709-10.72-17.905-18.788l-12.3-35.006c-.845-2.696-3.577-4.61-6.55-4.61h-48.235c-2.973 0-5.705 1.914-6.55 4.61l-12.3 35.005c-2.196 8.068-9.753 14.067-17.905 18.787L92.998 235.968c-2.507 1.456-4.325 3.696-5.034 6.38l-3.073 12.759v40.615c0 3.82-5.033 9.884-5.388 10.305-9.168 10.836-14.727 2
Read the rest
4.606-14.727 39.49v42.812C39.373 426.93 69.062 456.62 105.34 456.62h17.215c1.256 21.698 20.249 38.969 42.405 38.969s41.15-17.271 42.405-38.969h17.48c1.256 21.698 20.25 38.969 42.406 38.969s41.15-17.271 42.404-38.969H394.66c36.278 0 65.968-29.69 65.969-65.969v-42.812c0-14.884-5.559-28.654-14.727-39.491zm-189.9-4.337a77.079 77.079 0 0 0-4.225-.302c-19.322 0-35.012 15.689-35.012 35.012V375.99h74.25v-66.968c0-19.323-15.69-35.012-35.013-35.012zm208.12 0c-19.323 0-35.012 15.689-35.012 35.012v66.968h74.25v-66.968c0-19.323-15.69-35.012-35.012-35.012zm-118.63-66.968c10.286 0 18.632 8.345 18.632 18.632v48.424h-37.264v-48.424c0-10.287 8.345-18.632 18.632-18.632zm-27.944-18.633c-19.323 0-35.012 15.689-35.012 35.012V341.98H351.6V275.27c0-19.323-15.69-35.012-35.012-35.012zm-35.013-17.911c-10.287 0-18.632-8.346-18.632-18.633s8.345-18.632 18.632-18.632 18.632 8.346 18.632 18.632-8.345 18.633-18.632 18.633z"/></svg> I am not going to fault a language model for not getting that right! This is fundamentally not a language task. It demands an image model.
In GPT Unicorn has drawn a unicorn
I was curious about how they were getting GPT to generate images, the prompting is so simple[1] that GPT still blows my mind: async fetchImage(context) { const messages = context || [ { role: 'system', content: `You are a helpful assistant that generates SVG drawings. You respond only with SVG. You do not respond with text.` }, { role: 'user', content: `Draw a unicorn in SVG format. Dimensions: 500x500. Respond ONLY with a single SVG string. Do not respond with conversation or codeblocks.` } ] const response = await this.api.generateCompletion(messages) if (!isSvg(response.content)) { console.error('Generated image is not valid SVG:', response.content) messages.push({ role: 'assistant', content: response.content }) messages.push({ role: 'user', content: `The generated image is not valid SV
Read the rest
G. Please try again. Only respond with SVG code. No text.` }) return this.fetchImage(messages) } console.log('Generated image:', response.content) return response } [1] https://github.com/adamkdean/gpt-unicorn/blob/master/src/lib...
In GPT Unicorn has drawn a unicorn
And so, if we see that it /does/ get better, over the next few years, will that not lead us to ask /how/? Let's think about it: 1. It has to output SVG [1] 2. It is given a text based representation of what it must draw[2] 3. It must then somehow convert words -- the concept of a unicorn: equine with a horn, white, maybe rainbows? -- into SVG code, and attempt to convey both their location, shape, colour, appearance, with code. And keep in mind, this is just a token predictor. I doubt there is much data in its training that is this specific. So while it's quite far from science, for me, it's a bit of fun and I get emails every now and then remarking on things like the turd of May (2023-05-18) and it lightens the mood every now and then, which I think ultimately, is worth it. [1] System: You are a helpful assistant that generates SVG draw
Read the rest
ings. You respond only with SVG. You do not respond with text. [2] User: Draw a unicorn in SVG format. Dimensions: 500x500. Respond ONLY with a single SVG string. Do not respond with conversation or codeblocks. See: https://github.com/adamkdean/gpt-unicorn/blob/master/src/lib...
In GPT Unicorn has drawn a unicorn

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.