eliphatfs commited on
Commit
36df7de
1 Parent(s): 9c9fcc1

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +21 -12
README.md CHANGED
@@ -8,19 +8,28 @@ tags:
8
  - art
9
  ---
10
 
11
- How to use:
12
-
13
- 1. Copy or download `inference.py` from files.
14
- 2. Build a `Zero123PlusPipeline` with the checkpoint.
15
-
16
- Example usage:
17
 
 
18
  ```python
19
- pipeline = Zero123PlusPipeline.from_pretrained('sudo-ai/zero123plus-v1.1', torch_dtype=torch.float16)
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  pipeline.to('cuda:0')
21
- pipeline(
22
- to_rgb_image(Image.open(r"condition.png"))
23
- ).images[0].show()
 
 
24
  ```
25
-
26
- Condition needs to be in gray (127, 127, 127) or transparent (recommended) background.
 
8
  - art
9
  ---
10
 
11
+ Recommended version of `diffusers` is `0.20.2` with `torch` `2`.
 
 
 
 
 
12
 
13
+ Usage Example:
14
  ```python
15
+ import torch
16
+ import requests
17
+ from PIL import Image
18
+ from diffusers import DiffusionPipeline, EulerAncestralDiscreteScheduler
19
+
20
+ # Load the pipeline
21
+ pipeline = DiffusionPipeline.from_pretrained(
22
+ "sudo-ai/zero123plus-v1.1", custom_pipeline="sudo-ai/zero123plus-pipeline",
23
+ torch_dtype=torch.float16
24
+ )
25
+ # Feel free to tune the scheduler
26
+ pipeline.scheduler = EulerAncestralDiscreteScheduler.from_config(
27
+ pipeline.scheduler.config, timestep_spacing='trailing'
28
+ )
29
  pipeline.to('cuda:0')
30
+ # Run the pipeline
31
+ cond = Image.open(requests.get("https://d.skis.ltd/nrp/sample-data/lysol.png", stream=True).raw)
32
+ result = pipeline(cond).images[0]
33
+ result.show()
34
+ result.save("output.png")
35
  ```