Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,6 @@ import random
|
|
5 |
import os
|
6 |
from PIL import Image
|
7 |
from deep_translator import GoogleTranslator
|
8 |
-
from langdetect import detect
|
9 |
|
10 |
API_URL = "https://api-inference.huggingface.co/models/openskyml/dalle-3-xl"
|
11 |
API_TOKEN = os.getenv("HF_READ_TOKEN")
|
@@ -24,11 +23,8 @@ def query(prompt, model, is_negative=False, steps=30, cfg_scale=7, sampler="DPM+
|
|
24 |
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
25 |
key = random.randint(0, 999)
|
26 |
|
27 |
-
|
28 |
-
|
29 |
-
if language == 'ru':
|
30 |
-
prompt = GoogleTranslator(source='ru', target='en').translate(prompt)
|
31 |
-
print(f'\033[1mГенерация {key} перевод:\033[0m {prompt}')
|
32 |
|
33 |
prompt = f"{prompt} | ultra detail, ultra elaboration, ultra quality, perfect."
|
34 |
print(f'\033[1mГенерация {key}:\033[0m {prompt}')
|
|
|
5 |
import os
|
6 |
from PIL import Image
|
7 |
from deep_translator import GoogleTranslator
|
|
|
8 |
|
9 |
API_URL = "https://api-inference.huggingface.co/models/openskyml/dalle-3-xl"
|
10 |
API_TOKEN = os.getenv("HF_READ_TOKEN")
|
|
|
23 |
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
24 |
key = random.randint(0, 999)
|
25 |
|
26 |
+
prompt = GoogleTranslator(source='ru', target='en').translate(prompt)
|
27 |
+
print(f'\033[1mГенерация {key} перевод:\033[0m {prompt}')
|
|
|
|
|
|
|
28 |
|
29 |
prompt = f"{prompt} | ultra detail, ultra elaboration, ultra quality, perfect."
|
30 |
print(f'\033[1mГенерация {key}:\033[0m {prompt}')
|