Spaces:
Runtime error
Runtime error
Update app_sd.py
Browse files
app_sd.py
CHANGED
|
@@ -10,7 +10,7 @@ import os
|
|
| 10 |
MY_SECRET_TOKEN=os.environ.get('HF_TOKEN_SD')
|
| 11 |
YOUR_TOKEN=MY_SECRET_TOKEN
|
| 12 |
# load the pipeline
|
| 13 |
-
device = "
|
| 14 |
model_id_or_path = "CompVis/stable-diffusion-v1-4"
|
| 15 |
pipe = StableDiffusionImg2ImgPipeline.from_pretrained(
|
| 16 |
model_id_or_path,
|
|
@@ -31,7 +31,7 @@ init_image = init_image.resize((768, 512))
|
|
| 31 |
|
| 32 |
prompt = "Lively, illustration of a [[[<king::4>]]], portrait, fantasy, intricate, Scenic, hyperdetailed, hyper realistic <king-hearthstone>, unreal engine, 4k, smooth, sharp focus, intricate, cinematic lighting, highly detailed, octane, digital painting, artstation, concept art, vibrant colors, Cinema4D, WLOP, 3d render, in the style of hearthstone::5 art by Artgerm and greg rutkowski and magali villeneuve, martina jackova, Giger"
|
| 33 |
|
| 34 |
-
with autocast("cuda"):
|
| 35 |
images = pipe(prompt=prompt, init_image=init_image, strength=0.75, guidance_scale=7.5).images
|
| 36 |
|
| 37 |
images[0].save("fantasy_landscape.png")
|
|
|
|
| 10 |
MY_SECRET_TOKEN=os.environ.get('HF_TOKEN_SD')
|
| 11 |
YOUR_TOKEN=MY_SECRET_TOKEN
|
| 12 |
# load the pipeline
|
| 13 |
+
device = "cpu"
|
| 14 |
model_id_or_path = "CompVis/stable-diffusion-v1-4"
|
| 15 |
pipe = StableDiffusionImg2ImgPipeline.from_pretrained(
|
| 16 |
model_id_or_path,
|
|
|
|
| 31 |
|
| 32 |
prompt = "Lively, illustration of a [[[<king::4>]]], portrait, fantasy, intricate, Scenic, hyperdetailed, hyper realistic <king-hearthstone>, unreal engine, 4k, smooth, sharp focus, intricate, cinematic lighting, highly detailed, octane, digital painting, artstation, concept art, vibrant colors, Cinema4D, WLOP, 3d render, in the style of hearthstone::5 art by Artgerm and greg rutkowski and magali villeneuve, martina jackova, Giger"
|
| 33 |
|
| 34 |
+
with autocast(device): #"cuda"):
|
| 35 |
images = pipe(prompt=prompt, init_image=init_image, strength=0.75, guidance_scale=7.5).images
|
| 36 |
|
| 37 |
images[0].save("fantasy_landscape.png")
|