alfredplpl commited on
Commit
e4dd967
1 Parent(s): 832abe0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -4,16 +4,18 @@ import gradio as gr
4
  import torch
5
  from PIL import Image
6
  import random
 
7
 
8
  model_id = 'aipicasso/picasso-diffusion-1-0'
 
9
 
10
- scheduler = EulerAncestralDiscreteScheduler.from_pretrained(model_id, subfolder="scheduler")
11
- feature_extractor = CLIPFeatureExtractor.from_pretrained(model_id)
12
 
13
  pipe = StableDiffusionPipeline.from_pretrained(
14
  model_id,
15
  torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
16
- scheduler=scheduler)
17
  pipe.enable_xformers_memory_efficient_attention()
18
 
19
  pipe_i2i = StableDiffusionImg2ImgPipeline.from_pretrained(
@@ -22,7 +24,7 @@ pipe_i2i = StableDiffusionImg2ImgPipeline.from_pretrained(
22
  scheduler=scheduler,
23
  requires_safety_checker=False,
24
  safety_checker=None,
25
- feature_extractor=feature_extractor
26
  )
27
  pipe_i2i.enable_xformers_memory_efficient_attention()
28
 
 
4
  import torch
5
  from PIL import Image
6
  import random
7
+ import os
8
 
9
  model_id = 'aipicasso/picasso-diffusion-1-0'
10
+ token=os.environ.get("ACCESS_TOKEN")
11
 
12
+ scheduler = EulerAncestralDiscreteScheduler.from_pretrained(model_id, subfolder="scheduler", use_auth_token=token)
13
+ feature_extractor = CLIPFeatureExtractor.from_pretrained(model_id, use_auth_token=token)
14
 
15
  pipe = StableDiffusionPipeline.from_pretrained(
16
  model_id,
17
  torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
18
+ scheduler=scheduler, use_auth_token=token)
19
  pipe.enable_xformers_memory_efficient_attention()
20
 
21
  pipe_i2i = StableDiffusionImg2ImgPipeline.from_pretrained(
 
24
  scheduler=scheduler,
25
  requires_safety_checker=False,
26
  safety_checker=None,
27
+ feature_extractor=feature_extractor, use_auth_token=token
28
  )
29
  pipe_i2i.enable_xformers_memory_efficient_attention()
30