Prgckwb commited on
Commit
51838c6
1 Parent(s): 9c02482

:tada: add negative embedding

Browse files
Files changed (3) hide show
  1. README.md +0 -12
  2. app.py +3 -3
  3. requirements.txt +1 -0
README.md CHANGED
@@ -1,12 +0,0 @@
1
- ---
2
- title: Stable Diffusion Demo
3
- emoji: 🌖
4
- colorFrom: pink
5
- colorTo: yellow
6
- sdk: gradio
7
- sdk_version: 4.36.1
8
- app_file: app.py
9
- pinned: false
10
- ---
11
-
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
app.py CHANGED
@@ -33,8 +33,7 @@ if device == 'cuda':
33
  current_model_id,
34
  torch_dtype=dtype,
35
  ).to(device)
36
- else:
37
- dtype = torch.float32
38
 
39
 
40
  @dataclasses.dataclass
@@ -103,7 +102,8 @@ def inference(
103
  pipe = DiffusionPipeline.from_pretrained(
104
  model_id,
105
  torch_dtype=dtype,
106
- ).to(device)
 
107
 
108
  current_model_id = model_id
109
  except Exception as e:
 
33
  current_model_id,
34
  torch_dtype=dtype,
35
  ).to(device)
36
+
 
37
 
38
 
39
  @dataclasses.dataclass
 
102
  pipe = DiffusionPipeline.from_pretrained(
103
  model_id,
104
  torch_dtype=dtype,
105
+ )
106
+ pipe.enable_model_cpu_offload()
107
 
108
  current_model_id = model_id
109
  except Exception as e:
requirements.txt CHANGED
@@ -9,3 +9,4 @@ accelerate
9
  sentencepiece
10
  spaces
11
  Pillow
 
 
9
  sentencepiece
10
  spaces
11
  Pillow
12
+ protobuf