takamarou commited on
Commit
cd3c0aa
·
1 Parent(s): 95619c1

use diffusers library directly

Browse files
Files changed (2) hide show
  1. README.md +1 -1
  2. modules/app.py +3 -4
README.md CHANGED
@@ -8,7 +8,7 @@ sdk_version: 4.26.0
8
  app_file: app.py
9
  pinned: false
10
  preload_from_hub:
11
- - stabilityai/stable-diffusion-3-medium
12
  ---
13
 
14
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
8
  app_file: app.py
9
  pinned: false
10
  preload_from_hub:
11
+ - stabilityai/stable-diffusion-3-medium-diffusers
12
  ---
13
 
14
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
modules/app.py CHANGED
@@ -13,8 +13,7 @@ login(token=os.getenv("HF_TOKEN"))
13
  app = FastAPI(debug=True)
14
 
15
  pipeline = StableDiffusion3Pipeline.from_pretrained(
16
- "stabilityai/stable-diffusion-3-medium",
17
- revision="refs/pr/26",
18
  torch_dtype=torch.float16,
19
  )
20
  pipeline.to("cuda")
@@ -38,7 +37,7 @@ def generate(prompt, negative_prompt, num_inference_steps, height, width, guidan
38
  play = gr.Interface(
39
  fn=generate,
40
  inputs=[
41
- gr.Label(value="Image Generation Playground")
42
  gr.Textbox(label="Prompt", lines=3),
43
  gr.Textbox(label="Negative Prompt", lines=2),
44
  gr.Slider(label="Inference Steps", value=20, minimum=1, maximum=30, step=1),
@@ -52,7 +51,7 @@ play = gr.Interface(
52
  stickers = gr.Interface(
53
  fn=generate,
54
  inputs=[
55
- gr.Label(value="Sticker Optimization Console")
56
  gr.Textbox(label="Prompt", lines=3),
57
  gr.Textbox(label="Negative Prompt", lines=2),
58
  gr.Slider(label="Inference Steps", value=20, minimum=1, maximum=30, step=1),
 
13
  app = FastAPI(debug=True)
14
 
15
  pipeline = StableDiffusion3Pipeline.from_pretrained(
16
+ "stabilityai/stable-diffusion-3-medium-diffusers",
 
17
  torch_dtype=torch.float16,
18
  )
19
  pipeline.to("cuda")
 
37
  play = gr.Interface(
38
  fn=generate,
39
  inputs=[
40
+ gr.Label(value="Image Generation Playground"),
41
  gr.Textbox(label="Prompt", lines=3),
42
  gr.Textbox(label="Negative Prompt", lines=2),
43
  gr.Slider(label="Inference Steps", value=20, minimum=1, maximum=30, step=1),
 
51
  stickers = gr.Interface(
52
  fn=generate,
53
  inputs=[
54
+ gr.Label(value="Sticker Optimization Console"),
55
  gr.Textbox(label="Prompt", lines=3),
56
  gr.Textbox(label="Negative Prompt", lines=2),
57
  gr.Slider(label="Inference Steps", value=20, minimum=1, maximum=30, step=1),