Spaces:
Runtime error
Runtime error
Commit
·
5bca34d
1
Parent(s):
936baa4
Clean up call API
Browse files- text_to_image.py +5 -2
text_to_image.py
CHANGED
|
@@ -43,9 +43,12 @@ class TextToImageTool(Tool):
|
|
| 43 |
|
| 44 |
self.is_initialized = True
|
| 45 |
|
| 46 |
-
def __call__(self, prompt
|
| 47 |
if not self.is_initialized:
|
| 48 |
self.setup()
|
| 49 |
|
| 50 |
-
|
|
|
|
|
|
|
|
|
|
| 51 |
|
|
|
|
| 43 |
|
| 44 |
self.is_initialized = True
|
| 45 |
|
| 46 |
+
def __call__(self, prompt):
|
| 47 |
if not self.is_initialized:
|
| 48 |
self.setup()
|
| 49 |
|
| 50 |
+
negative_prompt = "low quality, bad quality, deformed, low resolution"
|
| 51 |
+
added_prompt = " , highest quality, highly realistic, very high resolution"
|
| 52 |
+
|
| 53 |
+
return self.pipeline(prompt + added_prompt, negative_prompt=negative_prompt, num_inference_steps=25).images[0]
|
| 54 |
|