Commit
•
167a199
1
Parent(s):
45d5e42
Update README.md (#1)
Browse files- Update README.md (dbca3bb272e42704010d0ba21a41aa3236e06270)
Co-authored-by: Muhammad Ahmed <[email protected]>
README.md
CHANGED
@@ -24,18 +24,20 @@ tags:
|
|
24 |
### Inference with a pipeline
|
25 |
|
26 |
```python
|
27 |
-
!pip install diffusers
|
28 |
|
29 |
import requests
|
30 |
from PIL import Image
|
31 |
from io import BytesIO
|
32 |
from diffusers import LDMSuperResolutionPipeline
|
|
|
33 |
|
|
|
34 |
model_id = "CompVis/ldm-super-resolution-4x-openimages"
|
35 |
|
36 |
# load model and scheduler
|
37 |
pipeline = LDMSuperResolutionPipeline.from_pretrained(model_id)
|
38 |
-
pipeline =
|
39 |
|
40 |
# let's download an image
|
41 |
url = "https://user-images.githubusercontent.com/38061659/199705896-b48e17b8-b231-47cd-a270-4ffa5a93fa3e.png"
|
|
|
24 |
### Inference with a pipeline
|
25 |
|
26 |
```python
|
27 |
+
!pip install git+https://github.com/duongna21/diffusers.git@add-sr-pipeline
|
28 |
|
29 |
import requests
|
30 |
from PIL import Image
|
31 |
from io import BytesIO
|
32 |
from diffusers import LDMSuperResolutionPipeline
|
33 |
+
import torch
|
34 |
|
35 |
+
device = "cuda" if torch.cuda.is_available() else "cpu"
|
36 |
model_id = "CompVis/ldm-super-resolution-4x-openimages"
|
37 |
|
38 |
# load model and scheduler
|
39 |
pipeline = LDMSuperResolutionPipeline.from_pretrained(model_id)
|
40 |
+
pipeline = pipeline.to(device)
|
41 |
|
42 |
# let's download an image
|
43 |
url = "https://user-images.githubusercontent.com/38061659/199705896-b48e17b8-b231-47cd-a270-4ffa5a93fa3e.png"
|