-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
adb66c7
commit 723bfc9
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Project Title | ||
|
||
Google Cloud Function for drawing Stability/DreamStudio.ai images. | ||
|
||
## Description | ||
|
||
I needed a way to programmaticly generate Stability/DreamStudio.ai images by simply making a call to a webservice. This GCF takes the URL request parameter 'draw' and returns a base64 encodes image. | ||
|
||
## Getting Started | ||
|
||
### Dependencies | ||
|
||
* Google Cloud account with access to Cloud Functions | ||
* DreamStudio.AI API key | ||
|
||
### Installing | ||
|
||
* create a new Cloud Function with Pyhton 3.7 as the language | ||
* define my_http_function as entry point | ||
* define your API KEY in main.py | ||
|
||
### Executing program | ||
|
||
* call the URL with the urlencoded request parameter ie `?draw=a%20windmill%20on%20a%20hill%2C%20trending%20on%20artstation` | ||
* decode the base64 images or display in HTML | ||
|
||
``` | ||
<img src="data:image/png;base64, base64data /> | ||
``` |