lixiang46 commited on
Commit
7870848
1 Parent(s): d4fa96f
Files changed (2) hide show
  1. app.py +5 -1
  2. requirements.txt +6 -6
app.py CHANGED
@@ -70,6 +70,7 @@ def infer(prompt,
70
  generator = torch.Generator().manual_seed(seed)
71
 
72
  if ip_adapter_image is None:
 
73
  image = pipe_t2i(
74
  prompt = prompt,
75
  negative_prompt = negative_prompt,
@@ -81,9 +82,12 @@ def infer(prompt,
81
  ).images[0]
82
  return image
83
  else:
 
 
 
84
  pipe_i2i.set_ip_adapter_scale([ip_adapter_scale])
85
  image = pipe_i2i(
86
- prompt= prompt ,
87
  ip_adapter_image=[ip_adapter_image],
88
  negative_prompt=negative_prompt,
89
  height=height,
 
70
  generator = torch.Generator().manual_seed(seed)
71
 
72
  if ip_adapter_image is None:
73
+ pipe_t2i.to(device)
74
  image = pipe_t2i(
75
  prompt = prompt,
76
  negative_prompt = negative_prompt,
 
82
  ).images[0]
83
  return image
84
  else:
85
+ pipe_i2i.to(device)
86
+ image_encoder.to(device)
87
+ pipe_i2i.image_encoder = image_encoder
88
  pipe_i2i.set_ip_adapter_scale([ip_adapter_scale])
89
  image = pipe_i2i(
90
+ prompt=prompt ,
91
  ip_adapter_image=[ip_adapter_image],
92
  negative_prompt=negative_prompt,
93
  height=height,
requirements.txt CHANGED
@@ -1,7 +1,7 @@
1
- accelerate
2
- diffusers
3
- invisible_watermark
4
- torch
5
- transformers
6
- sentencepiece
7
  gradio==4.38.1
 
1
+ accelerate==0.27.2
2
+ diffusers==0.28.2
3
+ invisible_watermark==0.2.0
4
+ torch==1.13.1
5
+ transformers==4.42.4
6
+ sentencepiece==0.1.99
7
  gradio==4.38.1