Tramac commited on
Commit
b372ff9
1 Parent(s): f2ef10f

fix app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -6,13 +6,11 @@ from diffusers import StableDiffusionPipeline
6
 
7
 
8
  repo = "Tramac/style-portrait-v1-5"
9
- # Ensure model and scheduler are initialized in GPU-enabled function
10
- if torch.cuda.is_available():
11
- pipeline = StableDiffusionPipeline.from_pretrained(
12
- repo,
13
- torch_dtype=torch.float16,
14
- variant="fp16"
15
- ).to("cuda")
16
 
17
  @spaces.GPU(enable_queue=True)
18
  def generate_image(prompt, neg_prompt):
@@ -50,4 +48,4 @@ with gr.Blocks() as demo:
50
  outputs=img,
51
  )
52
 
53
- demo.queue().launch(share=True)
 
6
 
7
 
8
  repo = "Tramac/style-portrait-v1-5"
9
+ pipeline = StableDiffusionPipeline.from_pretrained(
10
+ repo,
11
+ torch_dtype=torch.float16,
12
+ variant="fp16"
13
+ ).to("cuda")
 
 
14
 
15
  @spaces.GPU(enable_queue=True)
16
  def generate_image(prompt, neg_prompt):
 
48
  outputs=img,
49
  )
50
 
51
+ demo.queue().launch()