drakosfire commited on
Commit
a04510d
1 Parent(s): 1c94d3e

rebuilt img generator as class object

Browse files
__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
@@ -12,13 +12,16 @@ 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/card-generator-v1/blank-card-template-5.safetensors"
14
  detail_lora_path = "/media/drakosfire/Shared/models/stable-diffusion/card-generator-v1/add-detail-xl.safetensors"
 
15
  temp_image_path = "./image_temp/"
16
  card_pre_prompt = " blank magic card,high resolution, detailed intricate high quality border, textbox, high quality detailed magnum opus drawing of a "
17
  negative_prompts = "text, words, numbers, letters"
18
  image_list = []
19
 
20
- class img_generator():
21
- def load_img_gen(prompt, item, mimic = None):
 
 
22
  prompt = card_pre_prompt + item + ' ' + prompt
23
  print(prompt)
24
 
@@ -41,7 +44,7 @@ class img_generator():
41
  pipe.enable_vae_slicing()
42
  return pipe, prompt
43
 
44
- def preview_and_generate_image(x,pipe, prompt, user_input_template, item):
45
  img_start = time.time()
46
  image = pipe(prompt=prompt,
47
  strength = .9,
 
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/card-generator-v1/blank-card-template-5.safetensors"
14
  detail_lora_path = "/media/drakosfire/Shared/models/stable-diffusion/card-generator-v1/add-detail-xl.safetensors"
15
+ mimic_lora_path = :"/media/drakosfire/Shared/CardGenerator/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 = []
20
 
21
+ class img_generator():
22
+
23
+ def load_img_gen(self,prompt, item, mimic = None):
24
+ print(f"Input Prompt = {prompt} + Item : {item}")
25
  prompt = card_pre_prompt + item + ' ' + prompt
26
  print(prompt)
27
 
 
44
  pipe.enable_vae_slicing()
45
  return pipe, prompt
46
 
47
+ def preview_and_generate_image(self,x,pipe, prompt, user_input_template, item):
48
  img_start = time.time()
49
  image = pipe(prompt=prompt,
50
  strength = .9,
main.py CHANGED
@@ -112,6 +112,7 @@ with gr.Blocks() as demo:
112
  # Called when pressing button to generate image, updates gallery by returning the list of image URLs
113
  def generate_image_update_gallery(num_img, sd_prompt,item_name, built_template):
114
  delete_temp_images()
 
115
  image_list = []
116
  image_generator = img_generator()
117
  img_gen, prompt = image_generator.load_img_gen(sd_prompt, item_name)
 
112
  # Called when pressing button to generate image, updates gallery by returning the list of image URLs
113
  def generate_image_update_gallery(num_img, sd_prompt,item_name, built_template):
114
  delete_temp_images()
115
+ print(f"sd_prompt is a {type(sd_prompt)}")
116
  image_list = []
117
  image_generator = img_generator()
118
  img_gen, prompt = image_generator.load_img_gen(sd_prompt, item_name)