How to Make GPT-3 Draw

We saw a lot drawing or designing like this one how can I make gpt draw based on description?
My idea was to use pyautogui library to automate mouse movement and clicks, but is there any better ideas?

1 Like

I guess its a language model so its possible what about dall-e

1 Like

I forgot about dall-e however this is really advanced thing, I was thinking of combining nividia gaugan with gpt to ease the process of actual generating.

1 Like

One way to do it is just to instruct it to write CSS animations or whatever you’re looking for. In the same vein, I gave it the prompt, “Using JavaScript, CSS and HTML, you can make beautiful website frontends using only code. Take for example this frontend for a design portfolio website. The code is simple, but the effects are beautiful and eye-catching. Here is the source code as an example to get you started:”
And it completed:

HTML

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Design Portfolio</title> <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i,800,800i" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600,700,900,300,600i,700i,900i" rel="stylesheet"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css"> </head> <body> <div class="container"> <div class="row"> <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12"> <div class="block"> <h3 class="text-center">Zapisz się do newslettera.</h3> <form class="form-horizontal" action="#" method="post" novalidate> <div class="form-group"> <label for="email">Email</label> <input type="email" class="form-control" id="email" placeholder="Email"> </div> <button type="submit" class="btn btn-primary">Zapisz się</button> </form> </div> </div> </div> </div> </body> </html>

CSS

@import url(https://fonts.googleapis.com/css?family=Open+Sans); @import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro); body { background: #e8e8e8; font-family: 'Source Sans Pro', sans-serif; } .text-center { text-align: center; } .form-horizontal { display: inline-block; } .form-group { margin-bottom: 0; } .btn { padding: 15px 30px; border-radius: 5px; font-weight: 300; letter-spacing: .05em; line-height: 1.5em; color: #fff; background-color: #5cb85c; cursor: pointer; cursor: hand; } .btn:hover { color: #fff; background-color: #5fb85c; }

JavaScript

$(document).ready(function() { $('button').on('click', function() { var email = $('#email').val(); $.ajax({ type: 'POST', url: 'http://localhost:8000/api/email', data: { email: email }, success: function(response) { if (response.error) { alert(response.error.message); } else { alert(response.message); } $('#email').val(''); } }); }); });

With some very light editing, the code runs just fine in Codepen. I know the editing is very light because I don’t code in any of those three languages, haha.

I have frequently done the same to generate code for very simple CSS/JS animations.

2 Likes

@m-a.schenk to be honest I’m not really quite sure what your comment is getting at, but just to be clear, I am not indicating on CodePen that the code came from GPT-3, or posting it publicly at all, I’m just using it to see if it runs at all. CodePen is a coding sandbox so the likelihood of anything malicious being generated on accident is infinitesimally small, and even something deliberate would have to be so incredibly targeted and specific to affect them at all that using GPT-3 to generate the code wouldn’t be helpful in any way. Maybe you’re just saying that in a future version of GPT it theoretically could and someone might so we should start thinking about it now?

1 Like

gotcha. So what would that mean in this case? are you saying OpenAI should have something on that backend, or that my prompt should say “safe source code” instead of just “source code” maybe? What would secure by design mean to you.

JJK

1 Like

There are Deepfake algos with GANs that make exactly DALLE does, maybe better.