updated
Browse files
app.py
CHANGED
@@ -25,6 +25,16 @@ def query_hf_api(
|
|
25 |
model_url: str = "https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-xl-base-1.0",
|
26 |
max_retries: int = 3
|
27 |
) -> Optional[bytes]:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
"""
|
29 |
Query the Hugging Face Inference API with robust error handling and retry mechanism.
|
30 |
|
|
|
25 |
model_url: str = "https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-xl-base-1.0",
|
26 |
max_retries: int = 3
|
27 |
) -> Optional[bytes]:
|
28 |
+
|
29 |
+
# Enhanced configuration for realism
|
30 |
+
payload = {
|
31 |
+
"inputs": craft_realistic_prompt(prompt),
|
32 |
+
"parameters": {
|
33 |
+
"negative_prompt": "cartoon, anime, low quality, bad anatomy, blurry, unrealistic, painting, drawing, sketch",
|
34 |
+
"num_inference_steps": 75, # Increased steps
|
35 |
+
"guidance_scale": 8.5, # Higher guidance
|
36 |
+
}
|
37 |
+
}
|
38 |
"""
|
39 |
Query the Hugging Face Inference API with robust error handling and retry mechanism.
|
40 |
|