sumityadav329 commited on
Commit
5f15b99
·
verified ·
1 Parent(s): b253396
Files changed (1) hide show
  1. app.py +10 -0
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