Leeps commited on
Commit
26c0e0c
·
verified ·
1 Parent(s): ddfc8cd

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. api/index.py +6 -2
api/index.py CHANGED
@@ -68,6 +68,10 @@ def call_openai(pil_image):
68
  raise gr.Error("Unknown Error")
69
 
70
 
 
 
 
 
71
  def image_classifier(moodboard, prompt):
72
 
73
  if moodboard is not None:
@@ -82,7 +86,7 @@ def image_classifier(moodboard, prompt):
82
 
83
  input = {
84
  "prompt": "high quality render of " + prompt + ", " + openai_response[12:],
85
- "negative_prompt": "worst quality, low quality, illustration, 2d, painting, cartoons, sketch",
86
  "output_format": "jpg"
87
  }
88
 
@@ -120,7 +124,7 @@ def image_classifier(moodboard, prompt):
120
  "width": 768,
121
  "height": 768,
122
  "prompt": "high quality render of " + prompt + ", " + openai_response[12:],
123
- "negative_prompt": "worst quality, low quality, illustration, 2d, painting, cartoons, sketch",
124
  "refine": "expert_ensemble_refiner",
125
  "apply_watermark": False,
126
  "num_inference_steps": 25,
 
68
  raise gr.Error("Unknown Error")
69
 
70
 
71
+ # Todo -- better prompt generator, add another LLM layer combining the user prompt and moodboard description (in the case of the jacket, 'high quality render of yellow jacket, its fabric is a pattern of cosmic etc etc' worked well)
72
+ # Could even do this 4 different times to get more diversity of renders
73
+ # Add "simple" to prompt before word
74
+
75
  def image_classifier(moodboard, prompt):
76
 
77
  if moodboard is not None:
 
86
 
87
  input = {
88
  "prompt": "high quality render of " + prompt + ", " + openai_response[12:],
89
+ "negative_prompt": "worst quality, low quality, illustration, 2d, painting, cartoons, sketch, logo, buttons",
90
  "output_format": "jpg"
91
  }
92
 
 
124
  "width": 768,
125
  "height": 768,
126
  "prompt": "high quality render of " + prompt + ", " + openai_response[12:],
127
+ "negative_prompt": "worst quality, low quality, illustration, 2d, painting, cartoons, sketch, logo, buttons",
128
  "refine": "expert_ensemble_refiner",
129
  "apply_watermark": False,
130
  "num_inference_steps": 25,