Spaces:
vilarin
/
Running on Zero

vilarin commited on
Commit
010c481
1 Parent(s): 9ee250d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -63,10 +63,11 @@ tokenizer_3 = AutoTokenizer.from_pretrained(
63
 
64
  # Ensure model and scheduler are initialized in GPU-enabled function
65
  if torch.cuda.is_available():
66
- pipe = StableDiffusion3Pipeline.from_pretrained(repo, vae=vae, transformer=transformer, tokenizer=tokenizer_3, text_encoder_3=text_encoder_3, torch_dtype=torch.float16).to("cuda")
67
- pipe2 = StableDiffusion3Img2ImgPipeline.from_pretrained(repo, vae=vae, transformer=transformer, tokenizer=tokenizer_3, text_encoder_3=text_encoder_3, torch_dtype=torch.float16).to("cuda")
68
 
69
  pipe.scheduler = FlowMatchEulerDiscreteScheduler.from_config(pipe.scheduler.config)
 
70
  pipe2.scheduler = FlowMatchEulerDiscreteScheduler.from_config(pipe.scheduler.config)
71
 
72
  # Function
 
63
 
64
  # Ensure model and scheduler are initialized in GPU-enabled function
65
  if torch.cuda.is_available():
66
+ pipe = StableDiffusion3Pipeline.from_pretrained(repo, vae=vae, transformer=transformer, tokenizer_3=tokenizer_3, text_encoder_3=text_encoder_3, torch_dtype=torch.float16).to("cuda")
67
+ pipe2 = StableDiffusion3Img2ImgPipeline.from_pretrained(repo, vae=vae, transformer=transformer, tokenizer_3=tokenizer_3, text_encoder_3=text_encoder_3, torch_dtype=torch.float16).to("cuda")
68
 
69
  pipe.scheduler = FlowMatchEulerDiscreteScheduler.from_config(pipe.scheduler.config)
70
+ pipe.tokenizer_max_length = 512
71
  pipe2.scheduler = FlowMatchEulerDiscreteScheduler.from_config(pipe.scheduler.config)
72
 
73
  # Function