# Chat AI & Image Generator (aka Synthi)

**URL:** https://community.thunkable.com/t/chat-ai-image-generator-aka-synthi/2227603
**Category:** Questions about Thunkable X
**Created:** [January 18, 2023, 4:26am UTC](https://community.thunkable.com/t/chat-ai-image-generator-aka-synthi/2227603 "2023-01-18T04:26:13Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [January 18, 2023, 4:26am UTC](https://community.thunkable.com/t/chat-ai-image-generator-aka-synthi/2227603/1 "2023-01-18T04:26:13Z")

</div>

## Synthi Chat AI & Image Generator (work in progress)

### Overview

Thanks to @ioannisroungeris/@ioannis posting [this](https://community.thunkable.com/t/open-ai-chatgpt/2174483) a month ago, I started my deep dive into AI’s chat and image generator features.

I’ve put a lot of time into this project – before Thunkable [added blocks to help with all this](https://community.thunkable.com/t/openai-chatgpt-now-available-in-thunkable-with-our-new-integration/2209360) – and had to learn a lot about chat parameters, image generator prompts, and text-to-speech.

I’m calling it **Synthi** for now. So what does it do? It’s a conversational chat bot and image generator with a magic prompt option.

### Features

• **Chat bot:** Conversational, connects ideas from previous responses; can answer questions, tell jokes, summarize long texts, write essays, create code, etc. It uses Google Cloud Text-to-Speech for natural-sounding voice responses.  
(Ooh, is this [ChatGPT](https://chat.openai.com/chat)? ~~Nope but it’s close… it uses OpenAI’s text-davinci-003 API)~~ Yes, it’s now using the GPT-4 API as of 3/17/23.

• **Image generator:** Enter a description of an image and it will create two never seen before images from it  
(It uses DALL-E which is not as impressive as Stable Diffusion or MidJourney but this next feature helps…)

**• Added Stable Diffusion image generator 1/19/23**

• **Magic prompt generator:** You can enter a brief description such as “A stunning photo of the Eiffel tower at night with lights shining” and the app will return several enhanced prompts such as “A stunning photo of the Eiffel tower at night with lights shining on it, in the style of Caspar David stunning photo of the Eiffel tower at night with lights shining on it, award-winning.” You can choose any of those prompts to then generate additional images.

• **Share images:** Generated images can be exported as email or text message, or saved to photo album.

• **Negative prompt:** You can enter text to _exclude_ from a generated image.

• **DEMO button:** You can tap the DEMO button to see a sample AI-generated image. This might be helpful for someone who doesn’t have any experience with AI image generation and just wants to see an example of how it works.

I unfortunately can’t share the project because I’m quickly reaching my quota for image generation without paying for the service. And because I’ve put a bunch of hours into it! But here is a video where I show how it works:

### Screenshots

**Text Chat & DALL-E Image Generation**

 ![IMG_0011.PNG](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/e/fe9719955250e776e92a2b146d812092c6b2570b.jpeg) ![IMG_0010.PNG](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/8/7808cdf88aea4d17b87e3e5801e9254a738bde92.jpeg)

**Stable Diffusion & Negative Prompt**

 ![Stable Diffusion](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/e/2eb63e820d66ed3bfdcee079a2b239ea5e641ee1.jpeg) ![Negative prompt](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/d/ad954b88ea8a4c74097f79cd88d0ae5b62bb774f.jpeg)

**DEMO button**

 ![DEMO button](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/6/3628922d355928a62130bb03d4c207d3cb9941de.jpeg)

### Video

**Note:** this video was made with the first version of Synthi and does not include the updates posted later in this topic.

[![](https://img.youtube.com/vi/35EQQQBb-bU/maxresdefault.jpg "Synthi Demo") ](https://www.youtube.com/watch?v=35EQQQBb-bU)

---

<div class="post-metadata">

### Author: ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)
#### Post date: [January 18, 2023, 8:57am UTC](https://community.thunkable.com/t/chat-ai-image-generator-aka-synthi/2227603/2 "2023-01-18T08:57:16Z")

</div>

pretty impressive demo!

---

<div class="post-metadata">

### Author: ![venus99](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/venus99/32/146306_2.png) [@venus99](https://community.thunkable.com/u/venus99)
#### Post date: [January 18, 2023, 6:32pm UTC](https://community.thunkable.com/t/chat-ai-image-generator-aka-synthi/2227603/3 "2023-01-18T18:32:25Z")

</div>

Thanks for sharing this 🙂  
do you know if it is possible to use Stable Diffusion API inside of thinkable using the advanced web API feature?  
I’ve tried but have had no success

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [January 18, 2023, 6:59pm UTC](https://community.thunkable.com/t/chat-ai-image-generator-aka-synthi/2227603/4 "2023-01-18T18:59:51Z")

</div>

I love Stable Diffusion and it’s much better than DALL-E. I haven’t tried to get their API to work in Thunkable. What have you tried?

This looks promising: [https://api.stability.ai/docs#tag/v1alphageneration/operation/v1alpha/generation#textToImage](https://api.stability.ai/docs#tag/v1alphageneration/operation/v1alpha/generation#textToImage)

---

<div class="post-metadata">

### Author: ![venus99](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/venus99/32/146306_2.png) [@venus99](https://community.thunkable.com/u/venus99)
#### Post date: [January 18, 2023, 7:10pm UTC](https://community.thunkable.com/t/chat-ai-image-generator-aka-synthi/2227603/5 "2023-01-18T19:10:56Z")

</div>

Thanks for replying !  
I actually tried everything that’s possible ( even dumb solutions include using Initialize app variable API key and using it with the advanced API function) but didn’t get it to work I would love to search more and I’ll look into the link you’ve provided, if i can find anything I’ll update you here 🙂

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [January 18, 2023, 7:58pm UTC](https://community.thunkable.com/t/chat-ai-image-generator-aka-synthi/2227603/6 "2023-01-18T19:58:01Z")

</div>

This curl command works for me so it’s just a matter of converting that to Thunkable blocks (which arguably is the hard part!):

curl -f -sS --request POST “[https://api.stability.ai/v1alpha/generation/stable-diffusion-512-v2-0/text-to-image](https://api.stability.ai/v1alpha/generation/stable-diffusion-512-v2-0/text-to-image)” -H ‘Content-Type: application/json’ -H ‘Accept: image/png’ -H “Authorization: **[INSERT\_API\_KEY]**” --data-raw ‘{“cfg\_scale”: 7,“clip\_guidance\_preset”: “FAST\_BLUE”,“height”: 512,“width”: 512,“samples”: 1,“steps”: 50,“text\_prompts”: [{“text”: “A lighthouse on a cliff”,“weight”: 1}]}’ -o ~/Downloads/output.png

---

<div class="post-metadata">

### Author: ![venus99](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/venus99/32/146306_2.png) [@venus99](https://community.thunkable.com/u/venus99)
#### Post date: [January 18, 2023, 8:03pm UTC](https://community.thunkable.com/t/chat-ai-image-generator-aka-synthi/2227603/7 "2023-01-18T20:03:01Z")

</div>

Thank you that’s an amazing help for me!  
Are there any projects or videos you came across before that did something similar in terms of converting the command into blocks?

Thanks again.

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [January 18, 2023, 9:15pm UTC](https://community.thunkable.com/t/chat-ai-image-generator-aka-synthi/2227603/8 "2023-01-18T21:15:00Z")

</div>

It’s a lot of trial and error. It usually takes me a couple hours to figure out conversions from Curl to Thunkable.

---

<div class="post-metadata">

### Author: ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)
#### Post date: [January 19, 2023, 2:01pm UTC](https://community.thunkable.com/t/chat-ai-image-generator-aka-synthi/2227603/9 "2023-01-19T14:01:07Z")

</div>

@tatiang Excellent project! You did a fantastic job.

---

<div class="post-metadata">

### Author: ![venus99](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/venus99/32/146306_2.png) [@venus99](https://community.thunkable.com/u/venus99)
#### Post date: [January 19, 2023, 6:02pm UTC](https://community.thunkable.com/t/chat-ai-image-generator-aka-synthi/2227603/10 "2023-01-19T18:02:48Z")

</div>

An update 🙂  
i’ve tried the body row code in postman and it worked perfectly however when I tried to set the code in thunkable it didn’t work for some reason

The blocks I’ve used  
can you tell if there is something wrong ?

 ![333](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/2/d2c0e60e03e8398ebdb4219ce8c75f409733a415.png)

---

<div class="post-metadata">

### Author: ![matt\_conroy](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/matt_conroy/32/150843_2.png) [@matt\_conroy](https://community.thunkable.com/u/matt_conroy)
#### Post date: [January 19, 2023, 6:32pm UTC](https://community.thunkable.com/t/chat-ai-image-generator-aka-synthi/2227603/11 "2023-01-19T18:32:53Z")

</div>

My favorite thing about @tatiang’s Chat Bot is that even it cannot clearly explain offsides in football. 😂 ⚽

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [January 19, 2023, 6:45pm UTC](https://community.thunkable.com/t/chat-ai-image-generator-aka-synthi/2227603/12 "2023-01-19T18:45:05Z")

</div>

> [@matt\_conroy](#):
>
> My favorite thing about @tatiang’s Chat Bot is that even it cannot clearly explain offsides in football. 😂 ⚽

Nobody can! 🤪

I think that’s probably the ultimate turing test. 😉

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [January 19, 2023, 6:48pm UTC](https://community.thunkable.com/t/chat-ai-image-generator-aka-synthi/2227603/13 "2023-01-19T18:48:09Z")

</div>

The Stable Diffusion API requires authorization headers. You can’t use it without an API key.

---

<div class="post-metadata">

### Author: ![venus99](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/venus99/32/146306_2.png) [@venus99](https://community.thunkable.com/u/venus99)
#### Post date: [January 19, 2023, 6:51pm UTC](https://community.thunkable.com/t/chat-ai-image-generator-aka-synthi/2227603/14 "2023-01-19T18:51:36Z")

</div>

i have tried it with an API authorization header but still the same problem ☹  
 ![444444](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/2/e283e71446d09ab744e80fdbbdc35c47dd3bffce.png)

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [January 19, 2023, 7:00pm UTC](https://community.thunkable.com/t/chat-ai-image-generator-aka-synthi/2227603/15 "2023-01-19T19:00:39Z")

</div>

That looks right. But you also need the Accept header. If it still doesn’t work:

1. What’s the error message you’re seeing?
2. Double-check your API key. I thought I had copied and pasted it but somehow missed the first few characters.

---

<div class="post-metadata">

### Author: ![venus99](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/venus99/32/146306_2.png) [@venus99](https://community.thunkable.com/u/venus99)
#### Post date: [January 19, 2023, 7:08pm UTC](https://community.thunkable.com/t/chat-ai-image-generator-aka-synthi/2227603/16 "2023-01-19T19:08:06Z")

</div>

yes it took me hours of trying but nothing at the end  
The error message on the web is ( NetworkError when attempting to fetch resource.)  
so I’m exporting the apk file and testing it and I don’t get any error message when doing so  
I’ve tried the accept header as well and Double checked the API but no results

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [January 19, 2023, 7:19pm UTC](https://community.thunkable.com/t/chat-ai-image-generator-aka-synthi/2227603/17 "2023-01-19T19:19:15Z")

</div>

That’s frustrating! I’ve also spent hours… this is not easy stuff.

I noticed your endpoint is different than mine. I’m using this one which is also part of the curl command above:

[https://api.stability.ai/v1alpha/generation/stable-diffusion-512-v2-0/text-to-image](https://api.stability.ai/v1alpha/generation/stable-diffusion-512-v2-0/text-to-image)

---

<div class="post-metadata">

### Author: ![venus99](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/venus99/32/146306_2.png) [@venus99](https://community.thunkable.com/u/venus99)
#### Post date: [January 19, 2023, 7:29pm UTC](https://community.thunkable.com/t/chat-ai-image-generator-aka-synthi/2227603/18 "2023-01-19T19:29:06Z")

</div>

Thanks for everything you’ve shared  
and yes I’ve tried your endpoint at first with the same inputs and also different but I switched later to  
[https://stablediffusionapi.com/api/v3/text2img](https://stablediffusionapi.com/api/v3/text2img)

I guess I have to post it to the community maybe we can get it to work somehow!

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [January 19, 2023, 7:54pm UTC](https://community.thunkable.com/t/chat-ai-image-generator-aka-synthi/2227603/19 "2023-01-19T19:54:27Z")

</div>

**Update:** added Stable Diffusion image generator (see robot guardian image in first post above)

I don’t think I can (easily) add a magic prompt for Stable Diffusion but it will be impressive if I can…

---

<div class="post-metadata">

### Author: ![venus99](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/venus99/32/146306_2.png) [@venus99](https://community.thunkable.com/u/venus99)
#### Post date: [January 19, 2023, 8:00pm UTC](https://community.thunkable.com/t/chat-ai-image-generator-aka-synthi/2227603/20 "2023-01-19T20:00:26Z")

</div>

wow, that’s impressive!  
good work, I hope I can add it soon also

[Next page](https://community.thunkable.com/t/chat-ai-image-generator-aka-synthi/2227603.md?page=2)
