linoyts HF staff commited on
Commit
085a529
·
verified ·
1 Parent(s): cabaad6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -145,9 +145,11 @@ def preprocess_image(image: Image.Image,
145
  new_width, new_height = int(width * ratio), int(height * ratio)
146
  image = image['composite'].resize((new_width, new_height))
147
 
 
 
148
  prompt, negative_prompt = apply_style(style_name, prompt, negative_prompt)
149
 
150
- print(prompt, negative_prompt, style_name, num_steps, guidance_scale, controlnet_conditioning_scale)
151
  image = pipe_control(
152
  prompt=prompt,
153
  negative_prompt=negative_prompt,
@@ -535,6 +537,8 @@ with gr.Blocks(delete_cache=(600, 600), js=js_func) as demo:
535
  if __name__ == "__main__":
536
  pipeline = TrellisImageTo3DPipeline.from_pretrained("JeffreyXiang/TRELLIS-image-large")
537
  pipeline.cuda()
 
 
538
 
539
  #scribble controlnet
540
  controlnet = ControlNetModel.from_pretrained(
@@ -551,7 +555,7 @@ if __name__ == "__main__":
551
  # scheduler=eulera_scheduler,
552
  )
553
  pipe_control.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe_control.scheduler.config)
554
- pipe_control.to("cuda")
555
 
556
  # try:
557
  # pipeline.preprocess_image(Image.fromarray(np.zeros((512, 512, 3), dtype=np.uint8))) # Preload rembg
 
145
  new_width, new_height = int(width * ratio), int(height * ratio)
146
  image = image['composite'].resize((new_width, new_height))
147
 
148
+ print("image:",type(image))
149
+
150
  prompt, negative_prompt = apply_style(style_name, prompt, negative_prompt)
151
 
152
+ print("params:", prompt, negative_prompt, style_name, num_steps, guidance_scale, controlnet_conditioning_scale)
153
  image = pipe_control(
154
  prompt=prompt,
155
  negative_prompt=negative_prompt,
 
537
  if __name__ == "__main__":
538
  pipeline = TrellisImageTo3DPipeline.from_pretrained("JeffreyXiang/TRELLIS-image-large")
539
  pipeline.cuda()
540
+
541
+ device = "cuda" if torch.cuda.is_available() else "cpu"
542
 
543
  #scribble controlnet
544
  controlnet = ControlNetModel.from_pretrained(
 
555
  # scheduler=eulera_scheduler,
556
  )
557
  pipe_control.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe_control.scheduler.config)
558
+ pipe_control.to(device)
559
 
560
  # try:
561
  # pipeline.preprocess_image(Image.fromarray(np.zeros((512, 512, 3), dtype=np.uint8))) # Preload rembg