_Noxty commited on
Commit
e461317
·
verified ·
1 Parent(s): 23f446e

Update StableGR.py

Browse files
Files changed (1) hide show
  1. StableGR.py +18 -0
StableGR.py CHANGED
@@ -45,6 +45,24 @@ def uniq_urls(s):
45
  return to_urls(list_uniq(parse_urls(s) + parse_repos(s)))
46
 
47
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
 
49
  def download_file(dl_url, civitai_key, progress=gr.Progress(track_tqdm=True)):
50
  download_dir = TEMP_DIR
 
45
  return to_urls(list_uniq(parse_urls(s) + parse_repos(s)))
46
 
47
 
48
+ def generate_image(model_id, prompt, lora_A, num_steps, guidance_scale, sampler, img_width, img_height):
49
+ model = Model_Diffusers(
50
+ base_model_id=model_id,
51
+ task_name='txt2img',
52
+ )
53
+
54
+ image, info_image = model(
55
+ prompt=prompt,
56
+ lora_A=lora_A,
57
+ num_steps=num_steps,
58
+ guidance_scale=guidance_scale,
59
+ sampler=sampler,
60
+ img_width=img_width,
61
+ img_height=img_height,
62
+ )
63
+ return image[0]
64
+
65
+
66
 
67
  def download_file(dl_url, civitai_key, progress=gr.Progress(track_tqdm=True)):
68
  download_dir = TEMP_DIR