Spaces:
Nymbo
/
Running on CPU Upgrade

Rooni commited on
Commit
f00b283
1 Parent(s): 2f6b89f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -11,7 +11,7 @@ API_URL = "https://api-inference.huggingface.co/models/openskyml/dalle-3-xl"
11
  API_TOKEN = os.getenv("HF_READ_TOKEN") # it is free
12
  headers = {"Authorization": f"Bearer {API_TOKEN}"}
13
 
14
- models_list = ["AbsoluteReality v1.8.1", "DALL-E 3 XL", "Playground v2", "Openjourney v4", "Lyriel 1.6", "Animagine XL 2.0", "Counterfeit v2.5", "Realistic Vision 5.1", "Incursios v1.6", "Anime Detailer XL LoRA", "epiCRealism", "PixelArt XL", "NewReality XL"]
15
 
16
  def query(prompt, model, is_negative=False, steps=20, cfg_scale=7, seed=None):
17
  language = detect(prompt)
@@ -22,21 +22,21 @@ def query(prompt, model, is_negative=False, steps=20, cfg_scale=7, seed=None):
22
 
23
  if model == 'DALL-E 3 XL':
24
  API_URL = "https://api-inference.huggingface.co/models/openskyml/dalle-3-xl"
25
- if model == 'Playground v2':
26
  API_URL = "https://api-inference.huggingface.co/models/playgroundai/playground-v2-1024px-aesthetic"
27
- if model == 'Openjourney v4':
28
  API_URL = "https://api-inference.huggingface.co/models/prompthero/openjourney-v4"
29
- if model == 'AbsoluteReality v1.8.1':
30
  API_URL = "https://api-inference.huggingface.co/models/digiplay/AbsoluteReality_v1.8.1"
31
  if model == 'Lyriel 1.6':
32
  API_URL = "https://api-inference.huggingface.co/models/stablediffusionapi/lyrielv16"
33
  if model == 'Animagine XL 2.0':
34
  API_URL = "https://api-inference.huggingface.co/models/Linaqruf/animagine-xl-2.0"
35
- if model == 'Counterfeit v2.5':
36
  API_URL = "https://api-inference.huggingface.co/models/gsdf/Counterfeit-V2.5"
37
  if model == 'Realistic Vision 5.1':
38
  API_URL = "https://api-inference.huggingface.co/models/stablediffusionapi/realistic-vision-v51"
39
- if model == 'Incursios v1.6':
40
  API_URL = "https://api-inference.huggingface.co/models/digiplay/incursiosMemeDiffusion_v1.6"
41
  if model == 'Anime Detailer XL LoRA':
42
  API_URL = "https://api-inference.huggingface.co/models/Linaqruf/anime-detailer-xl-lora"
@@ -46,6 +46,8 @@ def query(prompt, model, is_negative=False, steps=20, cfg_scale=7, seed=None):
46
  API_URL = "https://api-inference.huggingface.co/models/nerijs/pixel-art-xl"
47
  if model == 'NewReality XL':
48
  API_URL = "https://api-inference.huggingface.co/models/stablediffusionapi/newrealityxl-global-nsfw"
 
 
49
 
50
  payload = {
51
  "inputs": prompt,
 
11
  API_TOKEN = os.getenv("HF_READ_TOKEN") # it is free
12
  headers = {"Authorization": f"Bearer {API_TOKEN}"}
13
 
14
+ models_list = ["AbsoluteReality 1.8.1", "DALL-E 3 XL", "Playground 2", "Openjourney 4", "Lyriel 1.6", "Animagine XL 2.0", "Counterfeit 2.5", "Realistic Vision 5.1", "Incursios 1.6", "Anime Detailer XL LoRA", "epiCRealism", "PixelArt XL", "NewReality XL", "Midjourney 4.0"]
15
 
16
  def query(prompt, model, is_negative=False, steps=20, cfg_scale=7, seed=None):
17
  language = detect(prompt)
 
22
 
23
  if model == 'DALL-E 3 XL':
24
  API_URL = "https://api-inference.huggingface.co/models/openskyml/dalle-3-xl"
25
+ if model == 'Playground 2':
26
  API_URL = "https://api-inference.huggingface.co/models/playgroundai/playground-v2-1024px-aesthetic"
27
+ if model == 'Openjourney 4':
28
  API_URL = "https://api-inference.huggingface.co/models/prompthero/openjourney-v4"
29
+ if model == 'AbsoluteReality 1.8.1':
30
  API_URL = "https://api-inference.huggingface.co/models/digiplay/AbsoluteReality_v1.8.1"
31
  if model == 'Lyriel 1.6':
32
  API_URL = "https://api-inference.huggingface.co/models/stablediffusionapi/lyrielv16"
33
  if model == 'Animagine XL 2.0':
34
  API_URL = "https://api-inference.huggingface.co/models/Linaqruf/animagine-xl-2.0"
35
+ if model == 'Counterfeit 2.5':
36
  API_URL = "https://api-inference.huggingface.co/models/gsdf/Counterfeit-V2.5"
37
  if model == 'Realistic Vision 5.1':
38
  API_URL = "https://api-inference.huggingface.co/models/stablediffusionapi/realistic-vision-v51"
39
+ if model == 'Incursios 1.6':
40
  API_URL = "https://api-inference.huggingface.co/models/digiplay/incursiosMemeDiffusion_v1.6"
41
  if model == 'Anime Detailer XL LoRA':
42
  API_URL = "https://api-inference.huggingface.co/models/Linaqruf/anime-detailer-xl-lora"
 
46
  API_URL = "https://api-inference.huggingface.co/models/nerijs/pixel-art-xl"
47
  if model == 'NewReality XL':
48
  API_URL = "https://api-inference.huggingface.co/models/stablediffusionapi/newrealityxl-global-nsfw"
49
+ if model == 'Midjourney 4.0':
50
+ API_URL = "https://api-inference.huggingface.co/models/openskyml/midjourney-v4-xl"
51
 
52
  payload = {
53
  "inputs": prompt,