drakosfire commited on
Commit
8e4ba16
·
1 Parent(s): 7a536d9

model pathing

Browse files
__pycache__/img2img.cpython-310.pyc CHANGED
Binary files a/__pycache__/img2img.cpython-310.pyc and b/__pycache__/img2img.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
 
card_generator.py CHANGED
@@ -23,7 +23,7 @@ test_item = {'Name': 'Pustulent Raspberry', 'Type': 'Fruit', 'Value': '1 cp', 'P
23
  # Function that takes in an image url and a dictionary and uses the values to print onto a card.
24
  def paste_image_and_resize(base_image,sticker_path, x_position, y_position,img_width, img_height, purchased_item_key = None):
25
 
26
- # Check for if item has a Rarity string that is a in the dictionary of sticket paths
27
  if purchased_item_key:
28
  if sticker_path[purchased_item_key]:
29
  sticker_path = sticker_path[purchased_item_key]
 
23
  # Function that takes in an image url and a dictionary and uses the values to print onto a card.
24
  def paste_image_and_resize(base_image,sticker_path, x_position, y_position,img_width, img_height, purchased_item_key = None):
25
 
26
+ # Check for if item has a Rarity string that is in the dictionary of sticker paths
27
  if purchased_item_key:
28
  if sticker_path[purchased_item_key]:
29
  sticker_path = sticker_path[purchased_item_key]
img2img.py CHANGED
@@ -9,11 +9,11 @@ from PIL import Image
9
  pipe = None
10
  start_time = time.time()
11
  torch.backends.cuda.matmul.allow_tf32 = True
12
- model_path = ("./models/stable-diffusion/card-generator-v1.safetensors")
13
- lora_path = "./models/stable-diffusion/Loras/blank-card-template-5.safetensors"
14
- detail_lora_path = "./models/stable-diffusion/Loras/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 "
18
  negative_prompts = "text, words, numbers, letters"
19
  image_list = []
 
9
  pipe = None
10
  start_time = time.time()
11
  torch.backends.cuda.matmul.allow_tf32 = True
12
+ model_path = ("models/stable-diffusion/card-generator-v1.safetensors")
13
+ lora_path = "models/stable-diffusion/Loras/blank-card-template-5.safetensors"
14
+ detail_lora_path = "models/stable-diffusion/Loras/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 "
18
  negative_prompts = "text, words, numbers, letters"
19
  image_list = []
main.py CHANGED
@@ -137,35 +137,36 @@ with gr.Blocks() as demo:
137
  <h2><b>First:</b> Build a Card Template</h2>
138
  </div>""")
139
  with gr.Row():
 
140
 
141
- # Template Gallery instructions
142
- gr.HTML(""" <div id="inner"> <header>
143
- <h3>1. Click a border from the 'Card Template Gallery'</h3>
144
- </div>""")
145
-
146
- border_gallery = gr.Gallery(label = "Card Template Gallery",
147
- scale = 2,
148
- value = useri.index_image_paths("Drakosfire/CardGenerator", "seed_images/card_templates"),
149
- show_label = True,
150
- columns = [3], rows = [3],
151
- object_fit = "contain",
152
- height = "auto",
153
- elem_id = "Template Gallery")
154
-
155
- gr.HTML(""" <div id="inner"> <header>
156
- <h3>2. Click a image from the Seed Image Gallery</h3><br>
157
- </div>""")
158
-
159
- border_gallery.select(assign_img_path, outputs = selected_border_image)
160
- seed_image_gallery = gr.Gallery(label= " Image Seed Gallery",
161
- scale = 2,
162
- value = useri.index_image_paths("Drakosfire/CardGenerator", "seed_images/item_seeds"),
163
- show_label = True,
164
- columns = [3], rows = [3],
165
- object_fit = "contain",
166
- height = "auto",
167
- elem_id = "Template Gallery",
168
- interactive=True)
169
 
170
  gr.HTML(""" <div id="inner"> <header><h4> -Or- Upload your own seed image, by dropping it into the 'Generated Template Gallery' </h4><br>
171
  <h3>3. Click 'Generate Card Template'</h3><br>
 
137
  <h2><b>First:</b> Build a Card Template</h2>
138
  </div>""")
139
  with gr.Row():
140
+ with gr.Column():
141
 
142
+ # Template Gallery instructions
143
+ gr.HTML(""" <div id="inner"> <header>
144
+ <h3>1. Click a border from the 'Card Template Gallery'</h3>
145
+ </div>""")
146
+
147
+ border_gallery = gr.Gallery(label = "Card Template Gallery",
148
+ scale = 2,
149
+ value = useri.index_image_paths("Drakosfire/CardGenerator", "seed_images/card_templates"),
150
+ show_label = True,
151
+ columns = [3], rows = [3],
152
+ object_fit = "contain",
153
+ height = "auto",
154
+ elem_id = "Template Gallery")
155
+ with gr.Column():
156
+ gr.HTML(""" <div id="inner"> <header>
157
+ <h3>2. Click a image from the Seed Image Gallery</h3><br>
158
+ </div>""")
159
+
160
+ border_gallery.select(assign_img_path, outputs = selected_border_image)
161
+ seed_image_gallery = gr.Gallery(label= " Image Seed Gallery",
162
+ scale = 2,
163
+ value = useri.index_image_paths("Drakosfire/CardGenerator", "seed_images/item_seeds"),
164
+ show_label = True,
165
+ columns = [3], rows = [3],
166
+ object_fit = "contain",
167
+ height = "auto",
168
+ elem_id = "Template Gallery",
169
+ interactive=True)
170
 
171
  gr.HTML(""" <div id="inner"> <header><h4> -Or- Upload your own seed image, by dropping it into the 'Generated Template Gallery' </h4><br>
172
  <h3>3. Click 'Generate Card Template'</h3><br>