Update README.md
Browse files
README.md
CHANGED
@@ -54,16 +54,19 @@ widget:
|
|
54 |
|
55 |
```python
|
56 |
import torch
|
57 |
-
from diffusers import DiffusionPipeline
|
58 |
-
|
59 |
|
60 |
|
61 |
model_id = "toilaluan/SigmaJourney"
|
62 |
-
prompt = "An astronaut is riding a horse through the jungles of Thailand."
|
63 |
negative_prompt = "malformed, disgusting, overexposed, washed-out"
|
64 |
|
65 |
-
pipeline = DiffusionPipeline.from_pretrained(
|
66 |
-
pipeline.
|
|
|
|
|
|
|
|
|
67 |
image = pipeline(
|
68 |
prompt=prompt,
|
69 |
negative_prompt='blurry, cropped, ugly',
|
@@ -71,9 +74,8 @@ image = pipeline(
|
|
71 |
generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(1641421826),
|
72 |
width=1024,
|
73 |
height=1024,
|
74 |
-
guidance_scale=
|
75 |
-
guidance_rescale=0.0,
|
76 |
).images[0]
|
77 |
-
image.save("output.png", format="
|
78 |
```
|
79 |
|
|
|
54 |
|
55 |
```python
|
56 |
import torch
|
57 |
+
from diffusers import DiffusionPipeline, EulerAncestralDiscreteScheduler
|
58 |
+
from diffusers.models import PixArtTransformer2DModel
|
59 |
|
60 |
|
61 |
model_id = "toilaluan/SigmaJourney"
|
|
|
62 |
negative_prompt = "malformed, disgusting, overexposed, washed-out"
|
63 |
|
64 |
+
pipeline = DiffusionPipeline.from_pretrained("PixArt-alpha/PixArt-Sigma-XL-2-1024-MS", torch_dtype=torch.float16)
|
65 |
+
pipeline.transformer = PixArtTransformer2DModel.from_pretrained(model_id, subfolder="transformer", torch_dtype=torch.float16)
|
66 |
+
pipeline.scheduler = EulerAncestralDiscreteScheduler.from_config(pipeline.scheduler.config)
|
67 |
+
pipeline.to('cuda' if torch.cuda.is_available() else 'cpu')
|
68 |
+
|
69 |
+
prompt = "On the left, there is a red cube. On the right, there is a blue sphere. On top of the red cube is a dog. On top of the blue sphere is a cat"
|
70 |
image = pipeline(
|
71 |
prompt=prompt,
|
72 |
negative_prompt='blurry, cropped, ugly',
|
|
|
74 |
generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(1641421826),
|
75 |
width=1024,
|
76 |
height=1024,
|
77 |
+
guidance_scale=5.5,
|
|
|
78 |
).images[0]
|
79 |
+
image.save("output.png", format="JPEG")
|
80 |
```
|
81 |
|