ngoctuanai commited on
Commit
fe42c78
1 Parent(s): 8d32264

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -21
app.py CHANGED
@@ -19,27 +19,21 @@ list_models = [
19
  def generate_txt2img(current_model, prompt, is_negative=False, image_style="None style", steps=50, cfg_scale=7,
20
  seed=None):
21
  if current_model == "SD-1.5":
22
- API_URL = "https://api-inference.huggingface.co/models/runwayml/stable-diffusion-v1-5"
23
- if current_model == "SDXL-1.0":
24
- API_URL = "https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-xl-base-1.0"
25
- if current_model == "OpenJourney-V4":
26
- API_URL = "https://api-inference.huggingface.co/models/prompthero/openjourney"
27
- if current_model == "Anything-V4":
28
- API_URL = "https://api-inference.huggingface.co/models/xyn-ai/anything-v4.0"
29
- if current_model == "Disney-Pixar-Cartoon":
30
- API_URL = "https://api-inference.huggingface.co/models/stablediffusionapi/disney-pixar-cartoon"
31
- if current_model == "Pixel-Art-XL":
32
- API_URL = "https://api-inference.huggingface.co/models/nerijs/pixel-art-xl"
33
- if current_model == "Dalle-3-XL":
34
- API_URL = "https://api-inference.huggingface.co/models/openskyml/dalle-3-xl"
35
- if current_model == "Midjourney-V4-XL":
36
- API_URL = "https://api-inference.huggingface.co/models/openskyml/midjourney-v4-xl"
37
-
38
- API_TOKEN = os.environ.get("HF_READ_TOKEN")
39
- headers = {"Authorization": f"Bearer {API_TOKEN}"}
40
-
41
- if image_style == "None style":
42
- payload = {
43
  "inputs": prompt + ", 8k",
44
  "is_negative": is_negative,
45
  "steps": steps,
 
19
  def generate_txt2img(current_model, prompt, is_negative=False, image_style="None style", steps=50, cfg_scale=7,
20
  seed=None):
21
  if current_model == "SD-1.5":
22
+ API_URL = "https://api-inference.huggingface.co/models/runwayml/stable-diffusion-v1-5"
23
+ elif current_model == "SDXL-1.0":
24
+ API_URL = "https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-xl-base-1.0"
25
+ elif current_model == "OpenJourney-V4":
26
+ API_URL = "https://api-inference.huggingface.co/models/prompthero/openjourney"
27
+ elif current_model == "Anything-V4":
28
+ API_URL = "https://api-inference.huggingface.co/models/xyn-ai/anything-v4.0"
29
+ elif current_model == "Disney-Pixar-Cartoon":
30
+ API_URL = "https://api-inference.huggingface.co/models/stablediffusionapi/disney-pixar-cartoon"
31
+ elif current_model == "Pixel-Art-XL":
32
+ API_URL = "https://api-inference.huggingface.co/models/nerijs/pixel-art-xl"
33
+ elif current_model == "Dalle-3-XL":
34
+ API_URL = "https://api-inference.huggingface.co/models/openskyml/dalle-3-xl"
35
+ elif current_model == "Midjourney-V4-XL":
36
+ API_URL = "https://api-inference.huggingface.co/models/openskyml/midjourney-v4-xl"
 
 
 
 
 
 
37
  "inputs": prompt + ", 8k",
38
  "is_negative": is_negative,
39
  "steps": steps,