Update README.md
Browse files
README.md
CHANGED
@@ -24,13 +24,24 @@ This pipeline was finetuned from **CompVis/stable-diffusion-v1-4** with replacem
|
|
24 |
You can use the pipeline like so:
|
25 |
|
26 |
```python
|
27 |
-
from diffusers import
|
28 |
import torch
|
29 |
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
```
|
35 |
|
36 |
## Training info
|
@@ -44,20 +55,3 @@ These are the key hyperparameters used during training:
|
|
44 |
* Image resolution:512
|
45 |
* Mixed-precision: bf16
|
46 |
|
47 |
-
|
48 |
-
|
49 |
-
## Intended uses & limitations
|
50 |
-
|
51 |
-
#### How to use
|
52 |
-
|
53 |
-
```python
|
54 |
-
# TODO: add an example code snippet for running this diffusion pipeline
|
55 |
-
```
|
56 |
-
|
57 |
-
#### Limitations and bias
|
58 |
-
|
59 |
-
[TODO: provide examples of latent issues and potential remediations]
|
60 |
-
|
61 |
-
## Training details
|
62 |
-
|
63 |
-
[TODO: describe the data used to train the model]
|
|
|
24 |
You can use the pipeline like so:
|
25 |
|
26 |
```python
|
27 |
+
from diffusers import StableDiffusionPipeline
|
28 |
import torch
|
29 |
|
30 |
+
# Set device
|
31 |
+
device = (
|
32 |
+
"mps"
|
33 |
+
if torch.backends.mps.is_available()
|
34 |
+
else "cuda"
|
35 |
+
if torch.cuda.is_available()
|
36 |
+
else "cpu"
|
37 |
+
)
|
38 |
+
torch_dtype = torch.float16 if device == "cuda" else torch.float32
|
39 |
+
pipeline = StableDiffusionPipeline.from_pretrained("jangmin/foodai-pipeline-ko", torch_dtype=torch_dtype)
|
40 |
+
pipeline.to(device)
|
41 |
+
|
42 |
+
prompt = "짜장면, 정면에서 본 사진, 그릇에 담긴"
|
43 |
+
image = pipeline(prompt, guidance_scale=8, num_inference_steps=35).images[0]
|
44 |
+
image
|
45 |
```
|
46 |
|
47 |
## Training info
|
|
|
55 |
* Image resolution:512
|
56 |
* Mixed-precision: bf16
|
57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|