Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
index.py
CHANGED
@@ -94,19 +94,21 @@ def main(text1, text2, prompt, dropdown_value, image_input):
|
|
94 |
|
95 |
# Encode the starter image to base64
|
96 |
starter_img = "data:image/jpeg;base64," + base64.b64encode(buffered.getvalue()).decode('utf-8')
|
|
|
97 |
else:
|
98 |
starter_img = img2imgstarter(prompt)
|
|
|
99 |
|
100 |
outputs = [text1]
|
101 |
output_amts = [2.25, 1.8, 1.5]
|
102 |
for amt in output_amts:
|
103 |
-
outputs.append(sdxl_api(text1, amt, prompt, starter_img,
|
104 |
|
105 |
outputs.append(sdxl_api("", 1, prompt, starter_img, .5))
|
106 |
|
107 |
output_amts.reverse()
|
108 |
for amt in output_amts:
|
109 |
-
outputs.append(sdxl_api(text2, amt, prompt, starter_img,
|
110 |
|
111 |
outputs.append(text2)
|
112 |
return outputs
|
|
|
94 |
|
95 |
# Encode the starter image to base64
|
96 |
starter_img = "data:image/jpeg;base64," + base64.b64encode(buffered.getvalue()).decode('utf-8')
|
97 |
+
prompt_strength=.75
|
98 |
else:
|
99 |
starter_img = img2imgstarter(prompt)
|
100 |
+
prompt_strength = .95
|
101 |
|
102 |
outputs = [text1]
|
103 |
output_amts = [2.25, 1.8, 1.5]
|
104 |
for amt in output_amts:
|
105 |
+
outputs.append(sdxl_api(text1, amt, prompt, starter_img, prompt_strength))
|
106 |
|
107 |
outputs.append(sdxl_api("", 1, prompt, starter_img, .5))
|
108 |
|
109 |
output_amts.reverse()
|
110 |
for amt in output_amts:
|
111 |
+
outputs.append(sdxl_api(text2, amt, prompt, starter_img, prompt_strength))
|
112 |
|
113 |
outputs.append(text2)
|
114 |
return outputs
|