Skip to content

Commit 239ed0f

Browse files
fix more
1 parent f3f60fc commit 239ed0f

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

scripts/txt2img.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def main():
266266

267267
x_samples_ddim = model.decode_first_stage(samples_ddim)
268268
x_samples_ddim = torch.clamp((x_samples_ddim + 1.0) / 2.0, min=0.0, max=1.0)
269-
x_samples_ddim = x_samples_ddim.cpu().permute(0, 2, 3, 1).numpy()
269+
x_samples_ddim = x_samples_ddim.cpu().permute(0, 2, 3, 1)
270270

271271
x_image = x_samples_ddim
272272
safety_checker_input = safety_feature_extractor(numpy_to_pil(x_image), return_tensors="pt")
@@ -295,11 +295,6 @@ def main():
295295
Image.fromarray(grid.astype(np.uint8)).save(os.path.join(outpath, f'grid-{grid_count:04}.png'))
296296
grid_count += 1
297297

298-
image = x_samples_ddim.cpu().permute(0, 2, 3, 1).numpy()
299-
300-
# run safety checker
301-
safety_checker_input = pipe.feature_extractor(numpy_to_pil(image), return_tensors="pt")
302-
image, has_nsfw_concept = pipe.safety_checker(images=image, clip_input=safety_checker_input.pixel_values)
303298
toc = time.time()
304299

305300
print(f"Your samples are ready and waiting for you here: \n{outpath} \n"

0 commit comments

Comments
 (0)