jangmin commited on
Commit
d21cf3b
1 Parent(s): acb0c84

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +16 -21
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 DiffusionPipeline
28
  import torch
29
 
30
- pipeline = DiffusionPipeline.from_pretrained("jangmin/foodai-pipeline-ko", torch_dtype=torch.float16)
31
- prompt = "해물 짬뽕"
32
- image = pipeline(prompt).images[0]
33
- image.save("my_image.png")
 
 
 
 
 
 
 
 
 
 
 
34
  ```
35
 
36
  ## Training info
@@ -45,19 +56,3 @@ These are the key hyperparameters used during training:
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
 
56
  * Mixed-precision: bf16
57
 
58