Skip to content

Commit a23faa2

Browse files
authored
add color dalle code example (#3108)
1 parent 6ca5f48 commit a23faa2

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ Let's go over an example: creating an image generation UI around [DALL·E](https
8080

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

83+
84+
8385
```python
8486
import reflex as rx
8587
import openai
@@ -108,6 +110,7 @@ class State(rx.State):
108110
self.image_url = response.data[0].url
109111
self.processing, self.complete = False, True
110112

113+
111114
def index():
112115
return rx.center(
113116
rx.vstack(
@@ -132,14 +135,22 @@ def index():
132135
height="100vh",
133136
)
134137

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

143+
144+
145+
146+
141147
## Let's break this down.
142148

149+
<div align="center">
150+
<img src="docs/images/dalle_colored_code_example.png" alt="Explaining the differences between backend and frontend parts of the DALL-E app." width="900" />
151+
</div>
152+
153+
143154
### **Reflex UI**
144155

145156
Let's start with the UI.
455 KB
Loading

0 commit comments

Comments
 (0)