Spaces:
Runtime error
Runtime error
root commited on
Commit ·
e551d7e
1
Parent(s): 6c257f1
Comment test method and remove share flag
Browse filesFiles changed (2)
- app.py+1-1
- image_generation.py+42-42
42 unmodified lines4344454647484942 unmodified linesoutputs=gen_image_grid,title="Image Generation",)app.launch(share=True)if __name__=="__main__":main()42 unmodified lines4344454647484942 unmodified linesoutputs=gen_image_grid,title="Image Generation",)app.launch()if __name__=="__main__":main()
14 unmodified lines15161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616214 unmodified linesbody out of frame, bad anatomy, watermark, signature, cut off, low contrast, \underexposed, overexposed, bad art, beginner, amateur, distorted face."# def generate_image(prompt,# negative_prompt,# model_id,# scheduler_name,# inference_steps,# guidance_scale):# scheduler = schedulers[scheduler_name].from_pretrained(model_id, subfolder="scheduler")# pipe = StableDiffusionPipeline.from_pretrained(model_id)# if scheduler_name != "None":# pipe.scheduler = scheduler# pipe = pipe.to(torch_device)# prompts = [prompt] * 4# negative_prompts = [negative_prompt] * 4# images = pipe(prompts, num_inference_steps=inference_steps, negative_prompt=negative_prompts, guidance_scale=float(guidance_scale)).images# return imagesdef generate_image(prompt,negative_prompt,model_dropdown,scheduler_dropdown,inference_steps,guidance_scale):print(prompt)print(negative_prompt)print(model_dropdown)print(scheduler_dropdown)print(inference_steps)print(guidance_scale)from PIL import Imageimport numpy as np# Create four noise imagesnoise_images = []for _ in range(4):# Generate random noise arraywidth, height = 512, 512 # Adjust as desirednoise = np.random.randint(0, 256, (height, width, 3), dtype=np.uint8)noise_image = Image.fromarray(noise)noise_images.append(noise_image)return noise_images14 unmodified lines15161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616214 unmodified linesbody out of frame, bad anatomy, watermark, signature, cut off, low contrast, \underexposed, overexposed, bad art, beginner, amateur, distorted face."def generate_image(prompt,negative_prompt,model_id,scheduler_name,inference_steps,guidance_scale):scheduler = schedulers[scheduler_name].from_pretrained(model_id, subfolder="scheduler")pipe = StableDiffusionPipeline.from_pretrained(model_id)if scheduler_name != "None":pipe.scheduler = schedulerpipe = pipe.to(torch_device)prompts = [prompt] * 4negative_prompts = [negative_prompt] * 4images = pipe(prompts, num_inference_steps=inference_steps, negative_prompt=negative_prompts, guidance_scale=float(guidance_scale)).imagesreturn images# def generate_image(prompt,# negative_prompt,# model_dropdown,# scheduler_dropdown,# inference_steps,# guidance_scale):# print(prompt)# print(negative_prompt)# print(model_dropdown)# print(scheduler_dropdown)# print(inference_steps)# print(guidance_scale)# from PIL import Image# import numpy as np# # Create four noise images# noise_images = []# for _ in range(4):# # Generate random noise array# width, height = 512, 512 # Adjust as desired# noise = np.random.randint(0, 256, (height, width, 3), dtype=np.uint8)# noise_image = Image.fromarray(noise)# noise_images.append(noise_image)# return noise_images
app.py+1-1
image_generation.py+42-42