Spaces:
Running
on
T4
Running
on
T4
Commit
·
f1f2536
1
Parent(s):
8f7fbb5
Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
from diffusers import AutoPipelineForText2Image, StableDiffusionImg2ImgPipeline
|
2 |
from PIL import Image
|
3 |
import gradio as gr
|
|
|
4 |
import random
|
5 |
import torch
|
6 |
-
import numpy
|
7 |
import math
|
8 |
|
9 |
css = """
|
@@ -26,8 +26,9 @@ def generate(prompt, samp_steps, seed, strength, progress=gr.Progress(track_tqdm
|
|
26 |
# guidance_scale=0.0,
|
27 |
# generator=torch.manual_seed(seed),
|
28 |
# ).images[0]
|
29 |
-
|
30 |
-
|
|
|
31 |
upscaled_image = image.resize((1024,1024), 1)
|
32 |
final_image = img2img(
|
33 |
prompt,
|
|
|
1 |
from diffusers import AutoPipelineForText2Image, StableDiffusionImg2ImgPipeline
|
2 |
from PIL import Image
|
3 |
import gradio as gr
|
4 |
+
import numpy as np
|
5 |
import random
|
6 |
import torch
|
|
|
7 |
import math
|
8 |
|
9 |
css = """
|
|
|
26 |
# guidance_scale=0.0,
|
27 |
# generator=torch.manual_seed(seed),
|
28 |
# ).images[0]
|
29 |
+
data=np.random.randint(low=0,high=256,size=128*128*3, dtype=np.uint8)
|
30 |
+
data=data.reshape(128,128,3)
|
31 |
+
image = Image.fromarray(data,'RGB')
|
32 |
upscaled_image = image.resize((1024,1024), 1)
|
33 |
final_image = img2img(
|
34 |
prompt,
|