Skip to content

Commit

Permalink
changed code snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
Aflalo committed Apr 2, 2024
1 parent f3feee4 commit e495691
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions ldm3d/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@ <h2 class="title is-3">How to use</h2>
<p>
<h3 class="title is-3">On GPU</h3>
<code>
<pre>
<script type="application/python">
<![CDATA[
from diffusers import StableDiffusionLDM3DPipeline
model_name = "Intel/ldm3d-4c"
pipe = StableDiffusionLDM3DPipeline.from_pretrained(model_name)
Expand All @@ -280,9 +283,15 @@ <h3 class="title is-3">On GPU</h3>
output = pipe( prompt, width=1024, height=512, guidance_scale=7.0, num_inference_steps=50 )
output.rgb[0].save("lemon_ldm3d_rgb.jpg")
output.depth[0].save("lemon_ldm3d_depth.png")
]]>
</script>
</pre>
</code>

<code>
<pre>
<script type="application/python">
<![CDATA[
from PIL import Image
from diffusers import StableDiffusionUpscaleLDM3DPipeline

Expand All @@ -297,13 +306,20 @@ <h3 class="title is-3">On GPU</h3>
upscaled_rgb, upscaled_depth =outputs.rgb[0], outputs.depth[0]
upscaled_rgb.save(f"upscaled_lemons_rgb.png")
upscaled_depth.save(f"upscaled_lemons_depth.png")
]]>
</script>
</pre>
</code>
<h3 class="title is-3">On Gaudi</h3>
</div>
<div style="display: flex; justify-content: center;">
<img src="https://huggingface.co/Intel/ldm3d-sr/resolve/main/ldm3d-sr-overview.png" width="600">
</div>
<code>from optimum.habana.diffusers import GaudiDDIMScheduler, GaudiStableDiffusionLDM3DPipeline
<code>
<pre>
<script type="application/python">
<![CDATA[
from optimum.habana.diffusers import GaudiDDIMScheduler, GaudiStableDiffusionLDM3DPipeline
from optimum.habana.utils import set _seed
model_name = "Intel/ldm3d-4c"
prompt = "A picture of some lemons on a table"
Expand All @@ -319,7 +335,9 @@ <h3 class="title is-3">On Gaudi</h3>
output_type="pil",
negative_prompt=None)
output.rgb[0].save("lemon_ldm3d_rgb.jpg")
output.depth[0].save("lemon_ldm3d_depth.png")</code>
output.depth[0].save("lemon_ldm3d_depth.png") ]]>
</script>
</pre></code>
</div>
</section>

Expand Down

0 comments on commit e495691

Please sign in to comment.