Spaces:
Runtime error
Runtime error
Commit
·
412c792
1
Parent(s):
8b147f3
Functioned for Stef run
Browse files- __pycache__/card_generator.cpython-310.pyc +0 -0
- __pycache__/img2img.cpython-310.pyc +0 -0
- __pycache__/item_dict_gen.cpython-310.pyc +0 -0
- __pycache__/main.cpython-310.pyc +0 -0
- __pycache__/template_builder.cpython-310.pyc +0 -0
- __pycache__/user_input.cpython-310.pyc +0 -0
- __pycache__/utilities.cpython-310.pyc +0 -0
- img2img.py +3 -3
- main.py +1 -1
- user_input.py +2 -1
- utilities.py +9 -9
__pycache__/card_generator.cpython-310.pyc
CHANGED
Binary files a/__pycache__/card_generator.cpython-310.pyc and b/__pycache__/card_generator.cpython-310.pyc differ
|
|
__pycache__/img2img.cpython-310.pyc
CHANGED
Binary files a/__pycache__/img2img.cpython-310.pyc and b/__pycache__/img2img.cpython-310.pyc differ
|
|
__pycache__/item_dict_gen.cpython-310.pyc
CHANGED
Binary files a/__pycache__/item_dict_gen.cpython-310.pyc and b/__pycache__/item_dict_gen.cpython-310.pyc differ
|
|
__pycache__/main.cpython-310.pyc
CHANGED
Binary files a/__pycache__/main.cpython-310.pyc and b/__pycache__/main.cpython-310.pyc differ
|
|
__pycache__/template_builder.cpython-310.pyc
CHANGED
Binary files a/__pycache__/template_builder.cpython-310.pyc and b/__pycache__/template_builder.cpython-310.pyc differ
|
|
__pycache__/user_input.cpython-310.pyc
CHANGED
Binary files a/__pycache__/user_input.cpython-310.pyc and b/__pycache__/user_input.cpython-310.pyc differ
|
|
__pycache__/utilities.cpython-310.pyc
CHANGED
Binary files a/__pycache__/utilities.cpython-310.pyc and b/__pycache__/utilities.cpython-310.pyc differ
|
|
img2img.py
CHANGED
@@ -9,9 +9,9 @@ from PIL import Image
|
|
9 |
pipe = None
|
10 |
start_time = time.time()
|
11 |
torch.backends.cuda.matmul.allow_tf32 = True
|
12 |
-
model_path = ("
|
13 |
-
lora_path = "
|
14 |
-
detail_lora_path = "./models/stable-diffusion/
|
15 |
mimic_lora_path = "./models/stable-diffusion/Loras/EnvyMimicXL01.safetensors"
|
16 |
temp_image_path = "./image_temp/"
|
17 |
card_pre_prompt = " blank magic card,high resolution, detailed intricate high quality border, textbox, high quality detailed magnum opus drawing of a "
|
|
|
9 |
pipe = None
|
10 |
start_time = time.time()
|
11 |
torch.backends.cuda.matmul.allow_tf32 = True
|
12 |
+
model_path = ("/media/drakosfire/Shared/models/stable-diffusion/card-generator-v1/card-generator-v1.safetensors")
|
13 |
+
lora_path = "/media/drakosfire/Shared/models/stable-diffusion/Loras/card-generator-v1/blank-card-template-5.safetensors"
|
14 |
+
detail_lora_path = "./models/stable-diffusion/card-generator-v1/add-detail-xl.safetensors"
|
15 |
mimic_lora_path = "./models/stable-diffusion/Loras/EnvyMimicXL01.safetensors"
|
16 |
temp_image_path = "./image_temp/"
|
17 |
card_pre_prompt = " blank magic card,high resolution, detailed intricate high quality border, textbox, high quality detailed magnum opus drawing of a "
|
main.py
CHANGED
@@ -299,7 +299,7 @@ with gr.Blocks() as demo:
|
|
299 |
|
300 |
|
301 |
if __name__ == '__main__':
|
302 |
-
demo.launch(server_name = "0.0.0.0", server_port = 8000, share =
|
303 |
|
304 |
|
305 |
|
|
|
299 |
|
300 |
|
301 |
if __name__ == '__main__':
|
302 |
+
demo.launch(server_name = "0.0.0.0", server_port = 8000, share = True, allowed_paths = ["/media/drakosfire/Shared/","/media/drakosfire/Shared/MerchantBot/card_templates"])
|
303 |
|
304 |
|
305 |
|
user_input.py
CHANGED
@@ -21,7 +21,8 @@ def index_image_paths(repo_name,directory_path):
|
|
21 |
files = []
|
22 |
for content_file in contents:
|
23 |
if content_file.type == "file":
|
24 |
-
|
|
|
25 |
|
26 |
return files
|
27 |
|
|
|
21 |
files = []
|
22 |
for content_file in contents:
|
23 |
if content_file.type == "file":
|
24 |
+
media_url = content_file.download_url.replace("raw.githubusercontent.com", "media.githubusercontent.com/media")
|
25 |
+
files.append(media_url) # Or content_file.path for just the path
|
26 |
|
27 |
return files
|
28 |
|
utilities.py
CHANGED
@@ -37,15 +37,15 @@ def directory_contents(directory_path):
|
|
37 |
|
38 |
# Delete a list of file
|
39 |
def delete_files(file_paths):
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
|
50 |
def open_image_from_url(image_url):
|
51 |
response = requests.get(image_url)
|
|
|
37 |
|
38 |
# Delete a list of file
|
39 |
def delete_files(file_paths):
|
40 |
+
if file_paths:
|
41 |
+
for file_path in file_paths:
|
42 |
+
try:
|
43 |
+
os.remove(f"./image_temp/{file_path}")
|
44 |
+
print(f"Remove : ./image_temp/{file_path}")
|
45 |
+
except OSError as e:
|
46 |
+
print(f"Error: {file_path} : {e.strerror}")
|
47 |
+
file_paths.clear()
|
48 |
+
|
49 |
|
50 |
def open_image_from_url(image_url):
|
51 |
response = requests.get(image_url)
|