Spaces:
Running
on
Zero
Running
on
Zero
Upload genimage.py
Browse files- genimage.py +4 -4
genimage.py
CHANGED
@@ -6,7 +6,7 @@ def load_pipeline():
|
|
6 |
import torch
|
7 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
8 |
pipe = DiffusionPipeline.from_pretrained(
|
9 |
-
"John6666/rae-diffusion-xl-v2-sdxl-spo-
|
10 |
custom_pipeline="lpw_stable_diffusion_xl",
|
11 |
torch_dtype=torch.float16,
|
12 |
)
|
@@ -38,9 +38,9 @@ def generate_image(prompt, neg_prompt):
|
|
38 |
"prompt": prompt,
|
39 |
"negative_prompt": neg_prompt,
|
40 |
"resolution": f"{1024} x {1024}",
|
41 |
-
"guidance_scale":
|
42 |
"num_inference_steps": 16,
|
43 |
-
"sampler": "
|
44 |
}
|
45 |
try:
|
46 |
images = pipe(
|
@@ -50,7 +50,7 @@ def generate_image(prompt, neg_prompt):
|
|
50 |
negative_prompt_2="lowres, (bad), text, error, fewer, extra, missing, worst quality, jpeg artifacts, low quality, watermark, unfinished, displeasing, oldest, early, chromatic aberration, signature, extra digits, artistic error, username, scan, [abstract], photo, deformed, disfigured, low contrast, photo, deformed, disfigured, low contrast",
|
51 |
width=1024,
|
52 |
height=1024,
|
53 |
-
guidance_scale=
|
54 |
num_inference_steps=16,
|
55 |
output_type="pil",
|
56 |
clip_skip=1,
|
|
|
6 |
import torch
|
7 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
8 |
pipe = DiffusionPipeline.from_pretrained(
|
9 |
+
"John6666/rae-diffusion-xl-v2-sdxl-spo-pcm",
|
10 |
custom_pipeline="lpw_stable_diffusion_xl",
|
11 |
torch_dtype=torch.float16,
|
12 |
)
|
|
|
38 |
"prompt": prompt,
|
39 |
"negative_prompt": neg_prompt,
|
40 |
"resolution": f"{1024} x {1024}",
|
41 |
+
"guidance_scale": 7.5,
|
42 |
"num_inference_steps": 16,
|
43 |
+
"sampler": "Euler",
|
44 |
}
|
45 |
try:
|
46 |
images = pipe(
|
|
|
50 |
negative_prompt_2="lowres, (bad), text, error, fewer, extra, missing, worst quality, jpeg artifacts, low quality, watermark, unfinished, displeasing, oldest, early, chromatic aberration, signature, extra digits, artistic error, username, scan, [abstract], photo, deformed, disfigured, low contrast, photo, deformed, disfigured, low contrast",
|
51 |
width=1024,
|
52 |
height=1024,
|
53 |
+
guidance_scale=7.5,
|
54 |
num_inference_steps=16,
|
55 |
output_type="pil",
|
56 |
clip_skip=1,
|