Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ from diffusers import DiffusionPipeline
|
|
7 |
import torch
|
8 |
|
9 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
10 |
-
model_repo_id = "
|
11 |
|
12 |
if torch.cuda.is_available():
|
13 |
torch_dtype = torch.float16
|
@@ -16,6 +16,7 @@ else:
|
|
16 |
|
17 |
pipe = DiffusionPipeline.from_pretrained(model_repo_id, torch_dtype=torch_dtype)
|
18 |
pipe = pipe.to(device)
|
|
|
19 |
|
20 |
MAX_SEED = np.iinfo(np.int32).max
|
21 |
MAX_IMAGE_SIZE = 1024
|
@@ -102,18 +103,18 @@ with gr.Blocks(css=css) as demo:
|
|
102 |
with gr.Row():
|
103 |
width = gr.Slider(
|
104 |
label="Width",
|
105 |
-
minimum=
|
106 |
maximum=MAX_IMAGE_SIZE,
|
107 |
-
step=
|
108 |
-
value=
|
109 |
)
|
110 |
|
111 |
height = gr.Slider(
|
112 |
label="Height",
|
113 |
-
minimum=
|
114 |
maximum=MAX_IMAGE_SIZE,
|
115 |
-
step=
|
116 |
-
value=
|
117 |
)
|
118 |
|
119 |
with gr.Row():
|
|
|
7 |
import torch
|
8 |
|
9 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
10 |
+
model_repo_id = "runwayml/stable-diffusion-v1-5" # Replace to the model you would like to use
|
11 |
|
12 |
if torch.cuda.is_available():
|
13 |
torch_dtype = torch.float16
|
|
|
16 |
|
17 |
pipe = DiffusionPipeline.from_pretrained(model_repo_id, torch_dtype=torch_dtype)
|
18 |
pipe = pipe.to(device)
|
19 |
+
pipe.load_lora_weights("OVAWARE/plixel-minecraft")
|
20 |
|
21 |
MAX_SEED = np.iinfo(np.int32).max
|
22 |
MAX_IMAGE_SIZE = 1024
|
|
|
103 |
with gr.Row():
|
104 |
width = gr.Slider(
|
105 |
label="Width",
|
106 |
+
minimum=16,
|
107 |
maximum=MAX_IMAGE_SIZE,
|
108 |
+
step=16,
|
109 |
+
value=256, # Replace with defaults that work for your model
|
110 |
)
|
111 |
|
112 |
height = gr.Slider(
|
113 |
label="Height",
|
114 |
+
minimum=16,
|
115 |
maximum=MAX_IMAGE_SIZE,
|
116 |
+
step=16,
|
117 |
+
value=256, # Replace with defaults that work for your model
|
118 |
)
|
119 |
|
120 |
with gr.Row():
|