Skip to content

Commit

Permalink
doc(SDXL): fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
ovuruska committed Apr 30, 2024
1 parent 8322a65 commit 198f49a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ print(transcription["text"])

```python
from deepinfra import Sdxl
import base64
import requests

model = Sdxl()
body = {
Expand All @@ -69,10 +69,11 @@ body = {
}
resp = model.generate(body)
image = resp["images"][0]
image = image.replace("data:image/png;base64,", "")
image_url = resp["output"][0]

with open("image.png", "wb") as fp:
fp.write(base64.b64decode(image))
# Write image_url to image.png
with open("image.png", "wb") as file:
file.write(requests.get(image_url).content)

```

Expand Down

0 comments on commit 198f49a

Please sign in to comment.