lvkaokao commited on
Commit
197c957
·
1 Parent(s): 6bbf751

update app

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -11,7 +11,8 @@ model_id = "dicoo_model"
11
 
12
  pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float)
13
 
14
- def predict(prompt, steps=50, seed=42, guidance_scale=7.5):
 
15
  print("prompt: ", prompt)
16
  print("steps: ", steps)
17
  image = pipe(prompt, num_inference_steps=steps, guidance_scale=7.5).images[0]
@@ -22,12 +23,12 @@ gr.Interface(
22
  predict,
23
  inputs=[
24
  gr.inputs.Textbox(label='Prompt', default='a lovely <dicoo> in red dress and hat, in the snowy and brightly night, with many brightly buildings'),
25
- gr.inputs.Slider(1, 100, label='Inference Steps', default=50, step=1),
26
  gr.inputs.Slider(0, 2147483647, label='Seed', default=random_seed, step=1),
27
  gr.inputs.Slider(1.0, 20.0, label='Guidance Scale - how much the prompt will influence the results', default=6.0, step=0.1),
28
  ],
29
  outputs=gr.Image(shape=[512, 512], type="pil", elem_id="output_image"),
30
  css="#output_image{width: 256px}",
31
  title="Demo of dicoo-finetuned-diffusion-model using Intel Neural Compressor 🧨",
32
- description="This Spaces app is same as <a href=\"https://huggingface.co/spaces/Intel/dicoo_diffusion\">Intel/dicoo_diffusion</a>, created by Intel AIA/AIPC team with the model fine-tuned with one shot (one image) for a newly introduced object \"dicoo\". To replicate the model fine-tuning, please refer to the code sample in <a href=\"https://github.com/intel/neural-compressor/tree/master/examples/pytorch/diffusion_model/diffusers/textual_inversion\">Intel Neural Compressor</a>. You may also refer to our <a href=\"https://medium.com/intel-analytics-software/personalized-stable-diffusion-with-few-shot-fine-tuning-on-a-single-cpu-f01a3316b13\">blog</a> for more details.",
33
  ).launch()
 
11
 
12
  pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float)
13
 
14
+ def predict(prompt, steps=30, seed=42, guidance_scale=7.5):
15
+ prompt = prompt
16
  print("prompt: ", prompt)
17
  print("steps: ", steps)
18
  image = pipe(prompt, num_inference_steps=steps, guidance_scale=7.5).images[0]
 
23
  predict,
24
  inputs=[
25
  gr.inputs.Textbox(label='Prompt', default='a lovely <dicoo> in red dress and hat, in the snowy and brightly night, with many brightly buildings'),
26
+ gr.inputs.Slider(1, 100, label='Inference Steps', default=30, step=1),
27
  gr.inputs.Slider(0, 2147483647, label='Seed', default=random_seed, step=1),
28
  gr.inputs.Slider(1.0, 20.0, label='Guidance Scale - how much the prompt will influence the results', default=6.0, step=0.1),
29
  ],
30
  outputs=gr.Image(shape=[512, 512], type="pil", elem_id="output_image"),
31
  css="#output_image{width: 256px}",
32
  title="Demo of dicoo-finetuned-diffusion-model using Intel Neural Compressor 🧨",
33
+ description="This Spaces app is same as <a href=\"https://huggingface.co/spaces/Intel/dicoo_diffusion\">Intel/dicoo_diffusion</a>, created by Intel AIA/AIPC team with the model fine-tuned with one shot (one image) for a newly introduced object \"dicoo\". To replicate the model fine-tuning, please refer to the code sample in <a href=\"https://github.com/intel/neural-compressor/tree/master/examples/pytorch/diffusion_model/diffusers/textual_inversion\">Intel Neural Compressor</a>. You may also refer to our <a href=\"https://medium.com/intel-analytics-software/personalized-stable-diffusion-with-few-shot-fine-tuning-on-a-single-cpu-f01a3316b13\">blog</a> for more details.\n **Tips:** -When inputting prompts, you need to contain the word **<dicoo>** which represents the pretrained object \"dicoo\". -For better generation, you maybe increase the inference steps.",
34
  ).launch()