Spaces:
Running
Running
Update app.py
Browse files21 unmodified lines222324252627282930313233343526 unmodified lines626364656667681 unmodified line70717273747521 unmodified linesAPI_TOKEN = random.choice([os.getenv("HF_READ_TOKEN"), os.getenv("HF_READ_TOKEN_2"), os.getenv("HF_READ_TOKEN_3"), os.getenv("HF_READ_TOKEN_4"), os.getenv("HF_READ_TOKEN_5")]) # it is freeheaders = {"Authorization": f"Bearer {API_TOKEN}"}language = detect(prompt)key = random.randint(0, 999)print(f'\033[1mГенерация {key}:\033[0m {prompt}')if language == 'ru':prompt = GoogleTranslator(source='ru', target='en').translate(prompt)print(f'\033[1mГенерация {key} перевод:\033[0m {prompt}')if model == 'DALL-E 3 XL':API_URL = "https://api-inference.huggingface.co/models/openskyml/dalle-3-xl"if model == 'Playground 2':26 unmodified linesAPI_URL = "https://api-inference.huggingface.co/models/DoctorDiffusion/doctor-diffusion-s-controllable-vector-art-xl-lora"if model == 'Disney':API_URL = "https://api-inference.huggingface.co/models/goofyai/disney_style_xl"prompt = f"Disney стиль. {prompt}"if model == 'CleanLinearMix':API_URL = "https://api-inference.huggingface.co/models/digiplay/CleanLinearMix_nsfw"if model == 'OrangeMixs':1 unmodified lineprompt = f"{prompt} | ультра детализация, ультра проработка, ультра качество, идеально."payload = {"inputs": prompt,"is_negative": is_negative,21 unmodified lines22232425262728293026 unmodified lines575859606162631 unmodified line6566676869707172737475767721 unmodified linesAPI_TOKEN = random.choice([os.getenv("HF_READ_TOKEN"), os.getenv("HF_READ_TOKEN_2"), os.getenv("HF_READ_TOKEN_3"), os.getenv("HF_READ_TOKEN_4"), os.getenv("HF_READ_TOKEN_5")]) # it is freeheaders = {"Authorization": f"Bearer {API_TOKEN}"}key = random.randint(0, 999)print(f'\033[1mГенерация {key}:\033[0m {prompt}')if model == 'DALL-E 3 XL':API_URL = "https://api-inference.huggingface.co/models/openskyml/dalle-3-xl"if model == 'Playground 2':26 unmodified linesAPI_URL = "https://api-inference.huggingface.co/models/DoctorDiffusion/doctor-diffusion-s-controllable-vector-art-xl-lora"if model == 'Disney':API_URL = "https://api-inference.huggingface.co/models/goofyai/disney_style_xl"prompt = f"Стиль Disney. {prompt}"if model == 'CleanLinearMix':API_URL = "https://api-inference.huggingface.co/models/digiplay/CleanLinearMix_nsfw"if model == 'OrangeMixs':1 unmodified lineprompt = f"{prompt} | ультра детализация, ультра проработка, ультра качество, идеально."language = detect(prompt)if language == 'ru':prompt = GoogleTranslator(source='ru', target='en').translate(prompt)print(f'\033[1mГенерация {key} перевод:\033[0m {prompt}')payload = {"inputs": prompt,"is_negative": is_negative,
app.py+8-6