This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from diffusers import DiffusionPipeline | |
from diffusers.utils import pt_to_pil | |
import torch, sys, random, gc | |
# A function to free up memory. | |
def flush(): | |
gc.collect() | |
torch.cuda.empty_cache() | |
# Pass image prompts from the command line in quotes "". |