Upload 3 files
Browse files
.gitattributes
CHANGED
@@ -131,3 +131,4 @@ Danbooru[[:space:]]Prompt[[:space:]]Selector/TEST2024/NAIA_0217_testv2.exe filte
|
|
131 |
Danbooru[[:space:]]Prompt[[:space:]]Selector/TEST2024/NAIA_0218_testv1.exe filter=lfs diff=lfs merge=lfs -text
|
132 |
Danbooru[[:space:]]Prompt[[:space:]]Selector/TEST2024/NAIA_0218_testv2.exe filter=lfs diff=lfs merge=lfs -text
|
133 |
Danbooru[[:space:]]Prompt[[:space:]]Selector/TEST2024/NAIA_0220_testv1.exe filter=lfs diff=lfs merge=lfs -text
|
|
|
|
131 |
Danbooru[[:space:]]Prompt[[:space:]]Selector/TEST2024/NAIA_0218_testv1.exe filter=lfs diff=lfs merge=lfs -text
|
132 |
Danbooru[[:space:]]Prompt[[:space:]]Selector/TEST2024/NAIA_0218_testv2.exe filter=lfs diff=lfs merge=lfs -text
|
133 |
Danbooru[[:space:]]Prompt[[:space:]]Selector/TEST2024/NAIA_0220_testv1.exe filter=lfs diff=lfs merge=lfs -text
|
134 |
+
Danbooru[[:space:]]Prompt[[:space:]]Selector/TEST2024/NAIA_0222_testv2.exe filter=lfs diff=lfs merge=lfs -text
|
Danbooru Prompt Selector/TEST2024/NAIA_0222_testv2.exe
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9baaef49ccf109a0801e668887076115b221036392d30f2af5d8bb210e43f6c7
|
3 |
+
size 888974587
|
Danbooru Prompt Selector/TEST2024/NAIA_0222_testv2.py
ADDED
The diff for this file is too large to render.
See raw diff
|
|
Danbooru Prompt Selector/TEST2024/NAIA_generation.py
CHANGED
@@ -4,10 +4,15 @@ from PIL import Image, ImageOps, ImageTk
|
|
4 |
from datetime import datetime
|
5 |
import time
|
6 |
from pathlib import Path
|
7 |
-
import io, re
|
8 |
import zipfile
|
9 |
|
10 |
-
BASE_URL="https://
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
def make_turbo_prompt(gen_request):
|
13 |
lines = gen_request['prompt']
|
@@ -264,18 +269,18 @@ def generate(gen_request):
|
|
264 |
params = {
|
265 |
"legacy": False,
|
266 |
"quality_toggle": True if gen_request["quality_toggle"] == 1 else False,
|
267 |
-
"width": gen_request["width"],
|
268 |
-
"height": gen_request["height"],
|
269 |
"n_samples": 1,
|
270 |
-
"seed": gen_request["seed"],
|
271 |
"extra_noise_seed": random.randint(0,9999999999),
|
272 |
"sampler": gen_request["sampler"],
|
273 |
"steps": 28 if gen_request["type"]!="upper" else gen_request["steps"],
|
274 |
"scale": gen_request["scale"],
|
275 |
"uncond_scale": gen_request["uncond_scale"],
|
276 |
"negative_prompt": ', '.join([keyword.strip() for keyword in gen_request["negative"].split(',') if not keyword.strip().startswith('#')]),
|
277 |
-
"sm" : gen_request["sema"],
|
278 |
-
"sm_dyn" : gen_request["sema_dyn"],
|
279 |
"decrisper": False,
|
280 |
"controlnet_strength": 1.0,
|
281 |
"add_original_image": False,
|
@@ -283,6 +288,11 @@ def generate(gen_request):
|
|
283 |
"noise_schedule": "native"
|
284 |
}
|
285 |
|
|
|
|
|
|
|
|
|
|
|
286 |
if gen_request["type"]=="inpaint":
|
287 |
if "mask" in gen_request:
|
288 |
params["mask"] = gen_request["mask"]
|
|
|
4 |
from datetime import datetime
|
5 |
import time
|
6 |
from pathlib import Path
|
7 |
+
import io, re, base64
|
8 |
import zipfile
|
9 |
|
10 |
+
BASE_URL="https://image.novelai.net"
|
11 |
+
|
12 |
+
def image_to_base64(image):
|
13 |
+
image_bytesIO = io.BytesIO()
|
14 |
+
image.save(image_bytesIO, format="PNG")
|
15 |
+
return base64.b64encode(image_bytesIO.getvalue()).decode()
|
16 |
|
17 |
def make_turbo_prompt(gen_request):
|
18 |
lines = gen_request['prompt']
|
|
|
269 |
params = {
|
270 |
"legacy": False,
|
271 |
"quality_toggle": True if gen_request["quality_toggle"] == 1 else False,
|
272 |
+
"width": int(gen_request["width"]),
|
273 |
+
"height": int(gen_request["height"]),
|
274 |
"n_samples": 1,
|
275 |
+
"seed": int(gen_request["seed"]),
|
276 |
"extra_noise_seed": random.randint(0,9999999999),
|
277 |
"sampler": gen_request["sampler"],
|
278 |
"steps": 28 if gen_request["type"]!="upper" else gen_request["steps"],
|
279 |
"scale": gen_request["scale"],
|
280 |
"uncond_scale": gen_request["uncond_scale"],
|
281 |
"negative_prompt": ', '.join([keyword.strip() for keyword in gen_request["negative"].split(',') if not keyword.strip().startswith('#')]),
|
282 |
+
"sm" : True if gen_request["sema"] == 1 else False,
|
283 |
+
"sm_dyn" : True if gen_request["sema_dyn"] == 1 else False,
|
284 |
"decrisper": False,
|
285 |
"controlnet_strength": 1.0,
|
286 |
"add_original_image": False,
|
|
|
288 |
"noise_schedule": "native"
|
289 |
}
|
290 |
|
291 |
+
if "image" not in gen_request and "reference_image" in gen_request:
|
292 |
+
params["reference_image"] = gen_request["reference_image"]
|
293 |
+
params["reference_information_extracted"] = gen_request["reference_information_extracted"]
|
294 |
+
params["reference_strength"] = gen_request["reference_strength"]
|
295 |
+
|
296 |
if gen_request["type"]=="inpaint":
|
297 |
if "mask" in gen_request:
|
298 |
params["mask"] = gen_request["mask"]
|