Update app.py
Browse files
app.py
CHANGED
@@ -108,20 +108,13 @@ COMPOSITION_PARAMS = {
|
|
108 |
}
|
109 |
|
110 |
class ImageGenerator:
|
111 |
-
|
112 |
-
self.API_URL =
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
if not token:
|
120 |
-
logger.error("HUGGINGFACE_TOKEN non trouvé!")
|
121 |
-
|
122 |
-
self.headers = {"Authorization": f"Bearer {token}"}
|
123 |
-
|
124 |
-
logger.info("ImageGenerator initialisé")
|
125 |
|
126 |
def _build_prompt(self, params: Dict[str, Any]) -> str:
|
127 |
"""Construction de prompt améliorée"""
|
|
|
108 |
}
|
109 |
|
110 |
class ImageGenerator:
|
111 |
+
def __init__(self):
|
112 |
+
self.API_URL = "https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-xl-base-1.0"
|
113 |
+
token = os.getenv('HUGGINGFACE_TOKEN')
|
114 |
+
if not token:
|
115 |
+
logger.error("HUGGINGFACE_TOKEN non trouvé!")
|
116 |
+
self.headers = {"Authorization": f"Bearer {token}"}
|
117 |
+
logger.info("ImageGenerator initialisé")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
|
119 |
def _build_prompt(self, params: Dict[str, Any]) -> str:
|
120 |
"""Construction de prompt améliorée"""
|