File size: 479 Bytes
389d1fc
 
 
 
 
 
 
 
4ecf70e
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from fastapi import FastAPI

app = FastAPI()

@app.get(“/”) def hello(): return {“message”: “Hello World”}



from diffusers import StableDiffusionLDM3DPipeline

pipe = StableDiffusionLDM3DPipeline.from_pretrained("Intel/ldm3d")
pipe.to("cuda")


prompt ="A picture of some lemons on a table"
name = "lemons"

output = pipe(prompt)
rgb_image, depth_image = output.rgb, output.depth
rgb_image[0].save(name+"_ldm3d_rgb.jpg")
depth_image[0].save(name+"_ldm3d_depth.png")