Artiprocher commited on
Commit
d0f7f8d
·
verified ·
1 Parent(s): 0215c28

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import os
2
  os.system("pip install diffsynth==2.0.3")
3
  from modelscope.hub.api import HubApi
@@ -40,6 +41,7 @@ pipe = ZImagePipeline.from_pretrained(
40
  tokenizer_config=ModelConfig(model_id="Tongyi-MAI/Z-Image-Turbo", origin_file_pattern="tokenizer/"),
41
  )
42
 
 
43
  def run_inference(style_image_1, style_image_2, style_image_3, style_image_4, style_image_5, style_image_6, prompt, negative_prompt, cfg_scale, sigma_shift, seed, num_inference_steps, height, width, progress=gr.Progress()):
44
  # Filter out None values and collect valid images
45
  style_images = [img for img in [style_image_1, style_image_2, style_image_3, style_image_4, style_image_5, style_image_6] if img is not None]
 
1
+ import spaces
2
  import os
3
  os.system("pip install diffsynth==2.0.3")
4
  from modelscope.hub.api import HubApi
 
41
  tokenizer_config=ModelConfig(model_id="Tongyi-MAI/Z-Image-Turbo", origin_file_pattern="tokenizer/"),
42
  )
43
 
44
+ @space.GPU(duration=60)
45
  def run_inference(style_image_1, style_image_2, style_image_3, style_image_4, style_image_5, style_image_6, prompt, negative_prompt, cfg_scale, sigma_shift, seed, num_inference_steps, height, width, progress=gr.Progress()):
46
  # Filter out None values and collect valid images
47
  style_images = [img for img in [style_image_1, style_image_2, style_image_3, style_image_4, style_image_5, style_image_6] if img is not None]