Skip to content

Commit

Permalink
Add images and missing imports
Browse files Browse the repository at this point in the history
  • Loading branch information
bddppq committed Sep 1, 2023
1 parent 180b9ad commit 2bcabb3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions advanced/sdxl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ c = Client(API_URL, token=TOKEN)

Text to Image:
```python
prompt = "A cat launching rockets into space"
prompt = "A cat launching rocket"
seed = 1234
image_bytes = c.txt2img(prompt=prompt, seed=seed)
with open("txt2img_prompt.png", "wb") as f:
Expand All @@ -29,15 +29,22 @@ with open("txt2img_prompt.png", "wb") as f:

Text to Image (with refiner):
```python
prompt = "A cat launching rockets into space"
prompt = "A cat launching rocket"
seed = 1234
image_bytes = c.txt2img(prompt=prompt, seed=seed, use_refiner=True)
with open("txt2img_prompt_refiner.png", "wb") as f:
f.write(image_bytes)
```
<img src="assets/txt2img.png" width=1024>

Inpaint
```python
import base64
import requests

from leptonai.photon import FileParam


img_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png"
mask_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png"
prompt = "A happy cat sitting on a bench"
Expand Down Expand Up @@ -73,6 +80,7 @@ image_bytes = c.inpaint(
with open("inpaint_base64.png", "wb") as f:
f.write(image_bytes)
```
<img src="assets/inpaint.png" width=1024>

## Dedicated SDXL inference service

Expand Down
Binary file added advanced/sdxl/assets/inpaint.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added advanced/sdxl/assets/txt2img.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2bcabb3

Please sign in to comment.