aelius commited on
Commit
1ae33da
1 Parent(s): beaeefc

minor edit

Browse files
Files changed (4) hide show
  1. app.py +1 -1
  2. poetry.lock +0 -0
  3. pyproject.toml +5 -0
  4. sirm2024_stablediff/main.py +10 -0
app.py CHANGED
@@ -7,5 +7,5 @@ style = st.selectbox('Style', ['Picasso', 'Van Gogh'], index=None)
7
 
8
  prompt_lst = [organ, modality, style]
9
  if None not in prompt_lst:
10
- prompt = ','.join()
11
  print(prompt)
 
7
 
8
  prompt_lst = [organ, modality, style]
9
  if None not in prompt_lst:
10
+ prompt = ','.join(prompt_lst)
11
  print(prompt)
poetry.lock CHANGED
The diff for this file is too large to render. See raw diff
 
pyproject.toml CHANGED
@@ -8,6 +8,11 @@ readme = "README.md"
8
  [tool.poetry.dependencies]
9
  python = "^3.11"
10
  streamlit = "^1.35.0"
 
 
 
 
 
11
 
12
 
13
  [build-system]
 
8
  [tool.poetry.dependencies]
9
  python = "^3.11"
10
  streamlit = "^1.35.0"
11
+ transformers = "^4.41.2"
12
+ accelerate = "^0.31.0"
13
+ invisible-watermark = ">=0.2.0"
14
+ diffusers = ">=0.19.0"
15
+ matplotlib = "^3.9.0"
16
 
17
 
18
  [build-system]
sirm2024_stablediff/main.py ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ from diffusers import DiffusionPipeline
2
+ import matplotlib.pyplot as plt
3
+ import torch
4
+
5
+ pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16, variant="fp16")
6
+ pipe.to("cuda")
7
+
8
+ prompt = "brain magnetic resonance imaging, kandinsky, high resolution, photorealistic"
9
+ image = pipe(prompt=prompt).images[0]
10
+ plt.imshow(image)