awacke1 commited on
Commit
072f36e
1 Parent(s): 05117f2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -3,6 +3,14 @@ import os
3
  os.system("git clone --recursive https://github.com/JD-P/cloob-latent-diffusion")
4
  os.system("cd cloob-latent-diffusion;pip install omegaconf pillow pytorch-lightning einops wandb ftfy regex ./CLIP")
5
 
 
 
 
 
 
 
 
 
6
  import argparse
7
  from functools import partial
8
  from pathlib import Path
@@ -35,6 +43,7 @@ ae_config_path = cached_download(hf_hub_url("huggan/ccld_wa", filename="ae_model
35
 
36
  # Define a few utility functions
37
 
 
38
  def parse_prompt(prompt, default_weight=3.):
39
  if prompt.startswith('http://') or prompt.startswith('https://'):
40
  vals = prompt.rsplit(':', 2)
 
3
  os.system("git clone --recursive https://github.com/JD-P/cloob-latent-diffusion")
4
  os.system("cd cloob-latent-diffusion;pip install omegaconf pillow pytorch-lightning einops wandb ftfy regex ./CLIP")
5
 
6
+ # setup some example images
7
+ examples = []
8
+ EXAMPLES_DIR = 'examples'
9
+ if os.path.isdir(EXAMPLES_DIR):
10
+ for file in os.listdir(EXAMPLES_DIR):
11
+ path = EXAMPLES_DIR + "/" + file
12
+ examples.append([path, DEFAULT_PROMPT])
13
+
14
  import argparse
15
  from functools import partial
16
  from pathlib import Path
 
43
 
44
  # Define a few utility functions
45
 
46
+
47
  def parse_prompt(prompt, default_weight=3.):
48
  if prompt.startswith('http://') or prompt.startswith('https://'):
49
  vals = prompt.rsplit(':', 2)