Spaces:
orrinin
/
Runtime error

orrinin commited on
Commit
01c2067
·
verified ·
1 Parent(s): 7009445

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -9,7 +9,6 @@ from typing import Tuple
9
  from translatepy import Translator
10
 
11
  MODEL = os.environ.get("MODEL")
12
- API_URL = "https://api-inference.huggingface.co/models/tianweiy/DMD2"
13
  DESCRIPTION = """
14
  # IMGEN🧚‍♀️
15
  <center>🧚‍♂️输入描述生成图片,选择喜欢的风格~<br>🧚高级选项可以设置生成数量和大小等</center>
@@ -72,7 +71,6 @@ style_list = [
72
  },
73
  ]
74
  styles = {k["name"]: (k["prompt"]) for k in style_list}
75
- print(styles)
76
  STYLE_NAMES = list(styles.keys())
77
  DEFAULT_STYLE_NAME = "(无风格)"
78
 
@@ -89,9 +87,9 @@ def generate(
89
  progress=gr.Progress(track_tqdm=True),
90
  ):
91
  prompt = str(translator.translate(prompt, 'English'))
92
- print(prompt)
93
  seed = int(randomize_seed_fn(seed, randomize_seed))
94
- # print(client.view_api())
95
 
96
  prompt = apply_style(style, prompt)
97
  strength = 0.7
@@ -103,8 +101,8 @@ def generate(
103
  steps,
104
  fn_index=1
105
  )
 
106
  images = result[0]
107
- print(images)
108
  image_paths = []
109
  # List[Dict(image: filepath, caption: str | None)]
110
  for img in images:
 
9
  from translatepy import Translator
10
 
11
  MODEL = os.environ.get("MODEL")
 
12
  DESCRIPTION = """
13
  # IMGEN🧚‍♀️
14
  <center>🧚‍♂️输入描述生成图片,选择喜欢的风格~<br>🧚高级选项可以设置生成数量和大小等</center>
 
71
  },
72
  ]
73
  styles = {k["name"]: (k["prompt"]) for k in style_list}
 
74
  STYLE_NAMES = list(styles.keys())
75
  DEFAULT_STYLE_NAME = "(无风格)"
76
 
 
87
  progress=gr.Progress(track_tqdm=True),
88
  ):
89
  prompt = str(translator.translate(prompt, 'English'))
90
+ print(f'prompt:{prompt}')
91
  seed = int(randomize_seed_fn(seed, randomize_seed))
92
+ print(client.view_api())
93
 
94
  prompt = apply_style(style, prompt)
95
  strength = 0.7
 
101
  steps,
102
  fn_index=1
103
  )
104
+ print(result)
105
  images = result[0]
 
106
  image_paths = []
107
  # List[Dict(image: filepath, caption: str | None)]
108
  for img in images: