xywwww commited on
Commit
0075f24
·
verified ·
1 Parent(s): 7e98b1f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -24,13 +24,13 @@ from huggingface_hub import hf_hub_download
24
  # pipeline = TrellisImageTo3DPipeline.from_pretrained("JeffreyXiang/TRELLIS-image-large")
25
  # model = model.cuda()
26
  # ddim_sampler = DDIMSampler(model)
27
- model = create_model('./models/cldm_v21_512_latctrl_coltrans.yaml').cpu()
28
  ckpt = hf_hub_download(repo_id="xywwww/scene_diffusion", filename="checkpoints/epoch=25-step=112553.ckpt")
29
  model.load_state_dict(load_state_dict(ckpt), strict=False)
30
  model = model.cuda()
31
  ddim_sampler = DDIMSampler(model)
32
 
33
-
34
  def process(input_image, prompt, a_prompt, n_prompt, num_samples, image_resolution, ddim_steps, guess_mode, strength, scale, seed, eta, low_threshold, high_threshold):
35
  with torch.no_grad():
36
  img = resize_image(HWC3(input_image), image_resolution)
 
24
  # pipeline = TrellisImageTo3DPipeline.from_pretrained("JeffreyXiang/TRELLIS-image-large")
25
  # model = model.cuda()
26
  # ddim_sampler = DDIMSampler(model)
27
+ model = create_model('./models/cldm_v21_512_latctrl_coltrans.yaml')
28
  ckpt = hf_hub_download(repo_id="xywwww/scene_diffusion", filename="checkpoints/epoch=25-step=112553.ckpt")
29
  model.load_state_dict(load_state_dict(ckpt), strict=False)
30
  model = model.cuda()
31
  ddim_sampler = DDIMSampler(model)
32
 
33
+ @spaces.GPU
34
  def process(input_image, prompt, a_prompt, n_prompt, num_samples, image_resolution, ddim_steps, guess_mode, strength, scale, seed, eta, low_threshold, high_threshold):
35
  with torch.no_grad():
36
  img = resize_image(HWC3(input_image), image_resolution)