Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add color dalle code example #3108

Merged
merged 4 commits into from
Apr 20, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ Let's go over an example: creating an image generation UI around [DALL·E](https

Here is the complete code to create this. This is all done in one Python file!



```python
import reflex as rx
import openai
Expand Down Expand Up @@ -108,6 +110,7 @@ class State(rx.State):
self.image_url = response.data[0].url
self.processing, self.complete = False, True


def index():
return rx.center(
rx.vstack(
Expand All @@ -132,14 +135,22 @@ def index():
height="100vh",
)


# Add state and page to the app.
app = rx.App()
app.add_page(index, title="Reflex:DALL-E")
```





## Let's break this down.

<div align="center">
<img src="docs/images/dalle_colored_code_example.png" alt="A frontend wrapper for DALL·E, shown in the process of generating an image." width="900" />
tgberkeley marked this conversation as resolved.
Show resolved Hide resolved
</div>


### **Reflex UI**

Let's start with the UI.
Expand Down
Binary file added docs/images/dalle_colored_code_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading