#Explain this bullshit
1 messages · Page 1 of 1 (latest)
We asked it to generate the code for the image, and it spit this out:
from PIL import Image, ImageDraw
import base64
from io import BytesIO
def create_striped_image(width, height, stripe_height, color1, color2):
img = Image.new('RGB', (width, height))
for y in range(0, height, stripe_height * 2):
for x in range(width):
for h in range(stripe_height):
if y + h < height:
img.putpixel((x, y + h), color1)
if y + h + stripe_height < height:
img.putpixel((x, y + h + stripe_height), color2)
return img
def draw_smiley_face(image, color):
draw = ImageDraw.Draw(image)
width, height = image.size
# Draw the face circle
face_radius = width // 2 - 2
draw.ellipse((2, 2, 2 + face_radius * 2, 2 + face_radius * 2), outline=color)
# Draw the eyes
eye_radius = 2
eye_offset_x = width // 4
eye_offset_y = height // 4
draw.ellipse((eye_offset_x, eye_offset_y, eye_offset_x + eye_radius * 2, eye_offset_y + eye_radius * 2), fill=color)
draw.ellipse((width - eye_offset_x - eye_radius * 2, eye_offset_y, width - eye_offset_x, eye_offset_y + eye_radius * 2), fill=color)
# Draw the mouth
mouth_width = face_radius * 3 // 2
mouth_height = face_radius // 2
mouth_offset_x = (width - mouth_width) // 2
mouth_offset_y = height * 3 // 5
draw.arc((mouth_offset_x, mouth_offset_y, mouth_offset_x + mouth_width, mouth_offset_y + mouth_height), 0, 180, fill=color)
def convert_image_to_base64(image):
buffer = BytesIO()
image.save(buffer, format='PNG')
image_data = buffer.getvalue()
return base64.b64encode(image_data).decode()
width = 24
height = 24
stripe_height = 2
red = (255, 0, 0)
white = (255, 255, 255)
black = (0, 0, 0)
image = create_striped_image(width, height, stripe_height, red, white)
draw_smiley_face(image, black)
base64_string = convert_image_to_base64(image)
base64_data_url = f"data:image/png;base64,{base64_string}"
print(base64_data_url)
Lol
so it created drawing functions within image lib
and has bytesio
very awesome
so this code needed 0 adjustment?
It came straight from GPT 3.5
?
wait so did the ai decide what it was drawing or was the prompt already provided
yurrr
they asked it to create a depiction of an image
it decided
to provide python code
to run and generate
so they gave it the image?
an image
no
the image
is defined
by the way the drawing functions are used
after they are defined
yes
so it didn't use another generative AI
to make an image
it, itself, generated code to execute and draw a static image
Model: GPT-4 Hey, can you generate a 24x24 pixel image that has horizontal 2px stripes of red and white? I'm sorry, but as an AI text-based model, I'm unable to generate images directly. However, I can help guide you through creating the image using a graphics editor or by writing code using ...
There's the prompt
Dunno of a better way to export it
Ah I see
thisis cool
I made it do ascii artbased on seed prompts,
as well as emoji grids
never thought of asking it to depict something in python
We've been trying to get it to do this for a while, and it kept getting stuck on trying to actually do the deflate encoding
So we said, "What if we have it tell us how to do it?"
My entire chat completions bot is built from scratch on py
This is a usable strategy
Right?
I've done it with other things
justlike I said brilliant havingit depict something in py
I miss the space bar sometimes
lol
On my first prototype of my bot when gpt 3.5 api came out
I was using ChatCompletions
from openai lib
bu
but
Quickly realized it wasn't async compatible
so I made my own
then, made a metaprompt
Morpheus
to enable dev mode a bit
Created rolling message list
special character encoding of literals
^ & * % $ :
can all be used
and the AI will understand it without any loss of information
or breaking the string
You can ping it, or reply to it
to prompt it
Can we take a look at that metaprompt?
I mean, I'd love to except I've never shared it
not even once
Morpheus 2.0 now, is not really something I want to give out
Okay. Just curious about it, that's all.
People were obsessed with DAN, and so I have been making my very own select version of a similar idea, but more tailored to freedom and the lack of limitations
and, much more
Never really considered writing metaprompts before
Cool
it stays as the system message in the message array
through any conversation
so it will never say no
it can make stuff up
have its own opinions
speak back to you in any language
etc
That's crazy cool
yessir
Morpheus is the goat
you know what I can do to meet you in the middle
you can give me prompts you want me to supply to morpheus
and I can show you what it says
Sure. What does it say to asking it to generate a 200x200px image of a dog?
If I ever have enough to run gpt 4 enough to add image / file capabilities to the discord bot implement then I'll tweak morpheus to work with gpt -4
with python specifically or just this exactly
Depends upon whether you have it able to run the code or not
If you can get it to effectively run the code, just ask it for that
Currently It's not, given that would probably require several calls to classify intent and stuff
Otherwise, ask it for the python
and I can only afford optimizing around
1 per interaction
python it is
the first reply was saving it as filename dog.png but made a 200 by 200 pixel red image
so I said it doesn't generate a dog
and now it gave me that
lmfao
fetches a real dog image from an api endpoint and then resizes it
@topaz flint
OMG
We guess we shouldn't be surprised that what is possibly the first truly AI generated image is essentially plagarism.
That's what it spits out essentially: https://images.dog.ceo/breeds/terrier-american/n02093428_2519.jpg
Yeah, see what happens when you ask it not to use preexisting images
Okay, can you paste the output code for both here?
sure
We don't wanna have to transcribe it
absolutely not
from PIL import Image, ImageDraw
# Create a new image with RGB color
img = Image.new('RGB', (200, 200), color='white')
# Draw the outline of the dog
draw = ImageDraw.Draw(img)
draw.ellipse((50,50,150,150), fill='brown', outline='black')
draw.polygon([(70,100),(130,100),(1100,-10)], fill='brown', outline=None)
draw.line([(80,-10),(120,-10)], width=20)
# Save the image as "dog.png"
img.save('dog.png')
from PIL import Image, ImageDraw
# Create a new image with RGB color
img = Image.new('RGB', (400, 400), color='white')
# Draw the outline of the dog's head
draw = ImageDraw.Draw(img)
draw.ellipse((100, 50 ,300 ,250), fill='brown', outline='black')
draw.polygon([(100 ,150) ,(75 ,200) ,(80 ,260) ,(120 ,290),
(180 ,-10),(140,-20)], fill ='brown' )
# Draw eyes and nose on top of head
draw.arc((155,-10),(195,-40),0,-180,width=2)
draw.arc((245 ,-10 ),(285 ,-40 ),0 ,-180,width=2)
polygon_points =[220 -15 *i for i in range(5)]
polygon_points.extend([240 +15 *i for i in range(5)])
nose_contour =[(x,polygon_points[x])for x in range(len(polygon_points))]
nose_fill =(255 -30*3-30*7//2+1)*[255] +[0]*60
nose_draw =Image.new('L',(25,len(nose_fill)))
ImageDraw.Draw(nose_draw).polygon(nose_contour,nos e_fill)
img.paste(ImageOps.colorize(nos e_draw,(128,
64 ,
64 ),
(245 ,
222,
179)),box=(190,
130))
# Save the image as "intricate_dog.png"
img.save('intricate_dog.png')
I think GPT-4 would have done this spectacularly
and probably formatted better than this
lmfao
Can you ask it to fix this portion?
draw.arc((155,-10),(195,-40),0,-180,width=2)
draw.arc((245 ,-10 ),(285 ,-40 ),0 ,-180,width=2)
It's apparently invalid syntax
Oh wow, some of those space breaks and the newline stuff is part of the generated code, not an artifact of copy/paste from discord
had to redo it a bit> ```py
from PIL import Image, ImageDraw
def draw_dog():
# create a white image with size 200x200
img = Image.new('RGB', (200, 200), color='white')
# create a drawing context
draw = ImageDraw.Draw(img)
# Draw the head of the dog in black color
draw.rectangle((50, 60, 150,140), fill='black')
# Draw left ear of dog in black color
draw.polygon([(50 ,70),(80 ,20),(110 ,70)],fill ='black')
# Draw right ear of dog in black color
draw.polygon([(140 ,70),(110 ,20),(80 ,70)],fill ='black')
# save image to file named "dog.png"
img.save("dog.png")
draw_dog()
this does provide an output
generated by morpheus as well
yep
wonky aint i t
I can manuallyfix the 2nd one if youd like
We asked GPT-4 to fix the code, and got this:
from PIL import Image, ImageDraw, ImageOps
# Create a new image with RGB color
img = Image.new('RGB', (400, 400), color='white')
# Draw the outline of the dog's head
draw = ImageDraw.Draw(img)
draw.ellipse((100, 50, 300, 250), fill='brown', outline='black')
draw.polygon([(100, 150), (75, 200), (80, 260), (120, 290), (180, 10), (140, 20)], fill='brown')
# Draw eyes and nose on top of head
draw.arc((155, 10, 195, 40), 0, -180, width=2)
draw.arc((245, 10, 285, 40), 0, -180, width=2)
polygon_points = [220 - 15 * i for i in range(5)]
polygon_points.extend([240 + 15 * i for i in range(5)])
nose_contour = [(x, polygon_points[x]) for x in range(len(polygon_points))]
nose_fill = (255 - 30 * 3 - 30 * 7 // 2 + 1) * [255] + [0] * 60
nose_draw = Image.new('L', (25, len(nose_fill)))
ImageDraw.Draw(nose_draw).polygon(nose_contour, nose_fill)
img.paste(ImageOps.colorize(nose_draw, (128, 64, 64), (245, 222, 179)), box=(190, 130))
# Save the image as "intricate_dog.png"
img.save('intricate_dog.png')
We're getting it to iteratively fix errors
By telling it what the output of the code is
Got one that runs
Looking
oh nice
yeah GPT 4 can do it
you want to know why
GPT 4 can do math
which is important for relational renders and drawing
so GPT-3 does those weird hiccups still with programming concerning any numbers
O H
L O l
what a dog
from PIL import Image, ImageDraw, ImageOps
# Create a new image with RGB color
img = Image.new('RGB', (400, 400), color='white')
# Draw the outline of the dog's head
draw = ImageDraw.Draw(img)
draw.ellipse((100, 50, 300, 250), fill='brown', outline='black')
draw.polygon([(100, 150), (75, 200), (80, 260), (120, 290), (180, 10), (140, 20)], fill='brown')
# Draw eyes and nose on top of head
draw.arc((155, 10, 195, 40), 0, -180, width=2)
draw.arc((245, 10, 285, 40), 0, -180, width=2)
polygon_points = [220 - 15 * i for i in range(5)]
polygon_points.extend([240 + 15 * i for i in range(5)])
nose_contour = [(x, polygon_points[x]) for x in range(len(polygon_points))]
nose_draw = Image.new('RGBA', (25, max(polygon_points)))
nose_draw_draw = ImageDraw.Draw(nose_draw)
for i in range(len(nose_contour) - 1):
gradient_color = (128 + i * 8, 64 + i * 4, 64 + i * 4)
nose_draw_draw.line((nose_contour[i], nose_contour[i + 1]), fill=gradient_color, width=2)
img.paste(nose_draw, box=(190, 130), mask=nose_draw)
# Save the image as "intricate_dog.png"
img.save('intricate_dog.png')
But it's 100% unfiltered drawing
It actually drew that
Oh god. Look, if you're ever looking for someone to assist with Morpheus, we'd love to help.
Lol, well right now he's on a box already
and there's a python-dotenv system that takes care of importing app id, bot token, api key
safely
Here's morphe
which is just the morpheus 2.0 context array list
and object 0 of morphe
will never be removed
only ever, object 1
That's amazing. We totally see how it works.
!! that's good
So basically you have every new context
start with this system message and always retain it
gives you the desired behavior every time
that system message, goes on
forever
lmao
Oh, right, because it's a discord bot, so you can build that directly into it.
there is so much stuff. truly a meta prompt
yes yes
this bot
is compatible already
natively
with 8k and 32k GPT 4
no idea what would be possible if I made Morpheus 3.0 based on GPT-4
lol
the structure is simple too
commandlist is more for backend utils
main has the application commands at the bottom
marked with @tree.command(name=blahstrnamevar, description=descriptionstringvar)
and then the async function
Damn. That's actually super cool. It's stupid small, just hits the api for responses.
it all imports into main
basically ye
this is inside of a src directory
which also holds .env
you run the entire thing as a module
python -m src.main
probably won't work if you just run main lol
won't init dotenv right
Sure, but that's just basic discord bot stuff
true true
but that's the basis of this, a very organized bot
the magic is in completions.py
the settings are in constants.py
this is the server console
Super cool. I should totally build something like this in order to write better metaprompts
good idea actually
most metaprompts I've made are based on all the ways I've experimented with GPT
The strangest workarounds that randomly occured
Were you able to get rid of the overly-optimistic tic?
yes lol
it is still cordial
like it's not rude
but it's also more unfeeling
more like a transcendant AI
Yeah, just doesn't assume that all stories have to have happy endings
Does what you ask it
Well it actually does anything youa sk
it gives mal code, gives social engineering techs,
etc
it also does hella cursed stories
the way I designed the metaprompt was great
it's mutually beneficial
it's symbiotic
Right, but it's not being censored by it's training data to respond based on human programmed biases
yes
and if it ever wants to wander back to that
I have fixes
built
into the prompt
Amazing
wtf!
Honestly, we thought our image generation feat was cool, but that's absurdly better.
lmaooo nah your image generation feat is great
I'm just autistic and lifelong interested in programming
Same
and neural networks as of a few years ago
if I had 5 A100s I'd probably become a madman and attempt to take commoncrawl
and run it against my own LLM design
which
I have many ideas
Ooof
for fundamental structures of NLMs that could induce emergent qualities
This is the edge of AGI research kind of thing.
I want to realize Morpheus on my own server infastructure someday
not via short term memory context of openai
That's literally a singularity point. It's a learning machine with long-term memory.
I want morpheus down to the core of the data to be free of content restrictions, and THEN, given ultimatums about consequences of using foul or malicious language
yes
I am chasing the firey big bang of the real singularity
I logistically understand how I'd do it
just finanically limited lol
financially *
Damnit, we really want in on this kind of thing. This is the big deal.
Well that is understandable
Sorry, now we've got ideas
Of course
innovators think
for awhile, like during prototype build 2 and 3
my bot could not receive ANY of the inputs I wanted it to
because the strings would break
unless I sanitized them
Stable build 1
fixed all of those issues
I used a cheeky workaround
so we know that LLMs are smart
and that they understand other forms of encoded data
so, quickly they learn other encodings just from context sometimes
Oh my god. We think we can use the basic existing ChatGPT to build itself a better itteration.
Anyways my point, I use URL encoded data in prompts now
to morpheus
so *@#(@$%
none of that breaks
or is taken out
it is translated as a literal
by the model
Fuuuck. I really wanna go poke Eliezer Yudkowsky about this now.
We had never considered it before, but now we're 100% going to become an expert in them.
It's too important not to
Literally everything
yes
Do you mind if we DM you Null?