Update app.py
Browse files
app.py
CHANGED
@@ -124,7 +124,8 @@ def infer_60(
|
|
124 |
seed = random.randint(0, MAX_SEED)
|
125 |
generator = torch.Generator(device='cuda').manual_seed(seed)
|
126 |
print('-- generating image --')
|
127 |
-
|
|
|
128 |
prompt=prompt,
|
129 |
prompt_2=prompt,
|
130 |
prompt_3=prompt,
|
@@ -137,7 +138,7 @@ def infer_60(
|
|
137 |
height=height,
|
138 |
generator=generator,
|
139 |
max_sequence_length=512
|
140 |
-
|
141 |
print('-- got image --')
|
142 |
timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
|
143 |
sd35_path = f"sd35ll_{timestamp}.png"
|
@@ -173,7 +174,8 @@ def infer_90(
|
|
173 |
seed = random.randint(0, MAX_SEED)
|
174 |
generator = torch.Generator(device='cuda').manual_seed(seed)
|
175 |
print('-- generating image --')
|
176 |
-
|
|
|
177 |
prompt=prompt,
|
178 |
prompt_2=prompt,
|
179 |
prompt_3=prompt,
|
@@ -186,7 +188,7 @@ def infer_90(
|
|
186 |
height=height,
|
187 |
generator=generator,
|
188 |
max_sequence_length=512
|
189 |
-
|
190 |
print('-- got image --')
|
191 |
timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
|
192 |
sd35_path = f"sd35ll_{timestamp}.png"
|
@@ -222,7 +224,8 @@ def infer_110(
|
|
222 |
seed = random.randint(0, MAX_SEED)
|
223 |
generator = torch.Generator(device='cuda').manual_seed(seed)
|
224 |
print('-- generating image --')
|
225 |
-
|
|
|
226 |
prompt=prompt,
|
227 |
prompt_2=prompt,
|
228 |
prompt_3=prompt,
|
@@ -235,7 +238,7 @@ def infer_110(
|
|
235 |
height=height,
|
236 |
generator=generator,
|
237 |
max_sequence_length=512
|
238 |
-
|
239 |
print('-- got image --')
|
240 |
timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
|
241 |
sd35_path = f"sd35ll_{timestamp}.png"
|
|
|
124 |
seed = random.randint(0, MAX_SEED)
|
125 |
generator = torch.Generator(device='cuda').manual_seed(seed)
|
126 |
print('-- generating image --')
|
127 |
+
with accelerator.autocast():
|
128 |
+
sd_image = pipe(
|
129 |
prompt=prompt,
|
130 |
prompt_2=prompt,
|
131 |
prompt_3=prompt,
|
|
|
138 |
height=height,
|
139 |
generator=generator,
|
140 |
max_sequence_length=512
|
141 |
+
).images[0]
|
142 |
print('-- got image --')
|
143 |
timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
|
144 |
sd35_path = f"sd35ll_{timestamp}.png"
|
|
|
174 |
seed = random.randint(0, MAX_SEED)
|
175 |
generator = torch.Generator(device='cuda').manual_seed(seed)
|
176 |
print('-- generating image --')
|
177 |
+
with accelerator.autocast():
|
178 |
+
sd_image = pipe(
|
179 |
prompt=prompt,
|
180 |
prompt_2=prompt,
|
181 |
prompt_3=prompt,
|
|
|
188 |
height=height,
|
189 |
generator=generator,
|
190 |
max_sequence_length=512
|
191 |
+
).images[0]
|
192 |
print('-- got image --')
|
193 |
timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
|
194 |
sd35_path = f"sd35ll_{timestamp}.png"
|
|
|
224 |
seed = random.randint(0, MAX_SEED)
|
225 |
generator = torch.Generator(device='cuda').manual_seed(seed)
|
226 |
print('-- generating image --')
|
227 |
+
with accelerator.autocast():
|
228 |
+
sd_image = pipe(
|
229 |
prompt=prompt,
|
230 |
prompt_2=prompt,
|
231 |
prompt_3=prompt,
|
|
|
238 |
height=height,
|
239 |
generator=generator,
|
240 |
max_sequence_length=512
|
241 |
+
).images[0]
|
242 |
print('-- got image --')
|
243 |
timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
|
244 |
sd35_path = f"sd35ll_{timestamp}.png"
|