ethe commited on
Commit
cf3a5f9
1 Parent(s): e7ce024

update torch float16 2 float32

Browse files
Files changed (1) hide show
  1. app.py +11 -8
app.py CHANGED
@@ -6,7 +6,7 @@ from diffusers import AutoencoderKL, StableDiffusionXLPipeline,StableDiffusionPi
6
  pipe = StableDiffusionPipeline.from_single_file(
7
  "https://huggingface.co/ethe/Architecture_model/blob/main/architectureExterior_v40Exterior.safetensors",
8
  # "/mnt/pfs-guan-ssai/cv/panxuhao/checkpoints/stable-diffusion-xl-base-1.0/sd_xl_base_1.0.safetensors",
9
- torch_dtype=torch.float16,
10
  # local_files_only=True,
11
  variant="fp16",
12
  use_safetensors=True,
@@ -32,15 +32,18 @@ def inference(prompt):
32
  ).images
33
  return image
34
 
35
- ref_image = gr.Image(height=512, width=512, label="参考图片")
36
- prompt = gr.Textbox(placeholder="输入你对室内设计的要求,以便 AI 能够更好地满足你的需求。", label="要求")
37
- result_image = gr.Gallery(label="可能满足你需求的室内设计图:",
38
- columns=3,
39
- height="auto",
40
- object_fit="contain")
 
 
 
41
  demo = gr.Interface(
42
  fn=inference,
43
- inputs=prompt,
44
  outputs=result_image
45
  )
46
 
 
6
  pipe = StableDiffusionPipeline.from_single_file(
7
  "https://huggingface.co/ethe/Architecture_model/blob/main/architectureExterior_v40Exterior.safetensors",
8
  # "/mnt/pfs-guan-ssai/cv/panxuhao/checkpoints/stable-diffusion-xl-base-1.0/sd_xl_base_1.0.safetensors",
9
+ torch_dtype=torch.float32,
10
  # local_files_only=True,
11
  variant="fp16",
12
  use_safetensors=True,
 
32
  ).images
33
  return image
34
 
35
+ with gr.Row():
36
+ input_prompt = gr.Textbox(placeholder="输入你对室内设计的要求,以便 AI 能够更好地满足你的需求。", label="要求")
37
+ with gr.Row():
38
+ ref_image = gr.Image(height=512, width=512, label="参考图片")
39
+
40
+ result_image = gr.Gallery(label="可能满足你需求的室内设计图:",
41
+ columns=3,
42
+ height="auto",
43
+ object_fit="contain")
44
  demo = gr.Interface(
45
  fn=inference,
46
+ inputs=input_prompt+prompt,
47
  outputs=result_image
48
  )
49