DigiP-AI commited on
Commit
7bd52eb
·
verified ·
1 Parent(s): aed116d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -16,10 +16,11 @@ from fastapi import FastAPI
16
 
17
  app = FastAPI()
18
 
19
- API_URL = "https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-3.5-large"
20
- API_TOKEN = os.getenv("HF_READ_TOKEN")
21
- headers = {"Authorization": f"Bearer {API_TOKEN}"}
22
- timeout = 100
 
23
 
24
  api_key = os.getenv("MISTRAL_API_KEY")
25
  Mistralclient = Mistral(api_key=api_key)
@@ -38,8 +39,7 @@ def query(prompt, is_negative=False, steps=35, cfg_scale=7, sampler="DPM++ 2M Ka
38
 
39
  key = random.randint(0, 999)
40
 
41
- API_TOKEN = random.choice([os.getenv("HF_READ_TOKEN")])
42
- headers = {"Authorization": f"Bearer {API_TOKEN}"}
43
 
44
  # Translate the prompt from Russian to English if necessary
45
  prompt = GoogleTranslator(source='ru', target='en').translate(prompt)
 
16
 
17
  app = FastAPI()
18
 
19
+ gr.load(
20
+ "models/stabilityai/stable-diffusion-3.5-large-turbo",
21
+ provider="hf-inference",
22
+ ) "https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-3.5-large"
23
+
24
 
25
  api_key = os.getenv("MISTRAL_API_KEY")
26
  Mistralclient = Mistral(api_key=api_key)
 
39
 
40
  key = random.randint(0, 999)
41
 
42
+
 
43
 
44
  # Translate the prompt from Russian to English if necessary
45
  prompt = GoogleTranslator(source='ru', target='en').translate(prompt)