Update main.py
Browse files
main.py
CHANGED
@@ -91,25 +91,25 @@ def generate_image(inputs, is_negative, steps, cfg_scale, seed):
|
|
91 |
|
92 |
|
93 |
|
|
|
|
|
94 |
def get_prompts(prompt_text):
|
95 |
if not prompt_text:
|
96 |
return "Please enter text before generating prompts.رجاء ادخل النص اولا"
|
97 |
raise gr.Error("Please enter text before generating prompts.رجاء ادخل النص اولا")
|
98 |
else:
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
else:
|
112 |
-
return text_gen("", timestamp)
|
113 |
|
114 |
def initialize_api_connection():
|
115 |
global headers
|
|
|
91 |
|
92 |
|
93 |
|
94 |
+
import time
|
95 |
+
|
96 |
def get_prompts(prompt_text):
|
97 |
if not prompt_text:
|
98 |
return "Please enter text before generating prompts.رجاء ادخل النص اولا"
|
99 |
raise gr.Error("Please enter text before generating prompts.رجاء ادخل النص اولا")
|
100 |
else:
|
101 |
+
options = [
|
102 |
+
"photo anime, masterpiece, high quality, absurdres, "
|
103 |
+
# Add other prompt options here...
|
104 |
+
]
|
105 |
+
|
106 |
+
if prompt_text:
|
107 |
+
# Use current time as a seed for random choice
|
108 |
+
random.seed(time.time())
|
109 |
+
chosen_option = random.choice(options)
|
110 |
+
return text_gen(f"{prompt_text}, {chosen_option}")
|
111 |
+
else:
|
112 |
+
return text_gen("")
|
|
|
|
|
113 |
|
114 |
def initialize_api_connection():
|
115 |
global headers
|