Text-to-Image
Diffusers
nielsr HF Staff commited on
Commit
d67482f
·
verified ·
1 Parent(s): b3f208a

Add pipeline tag and library name, add sample usage

Browse files

This PR improves the model card by:
- Adding the `pipeline_tag: text-to-image` to enhance discoverability on the Hugging Face Hub.
- Adding the `library_name: diffusers` to enable the automated code snippet for `diffusers`.
- Including a Python sample usage snippet directly from the GitHub README for text-to-image generation.

Files changed (1) hide show
  1. README.md +32 -1
README.md CHANGED
@@ -1,5 +1,7 @@
1
  ---
2
  license: cc-by-nc-nd-4.0
 
 
3
  ---
4
 
5
  # RealCustom Series
@@ -37,7 +39,36 @@ bash inference/inference_single_image.sh
37
  python inference/app.py
38
  ```
39
 
40
- ## Citation
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  If you find this project useful for your research, please consider citing our papers:
42
  ```bibtex
43
  @inproceedings{huang2024realcustom,
 
1
  ---
2
  license: cc-by-nc-nd-4.0
3
+ library_name: diffusers
4
+ pipeline_tag: text-to-image
5
  ---
6
 
7
  # RealCustom Series
 
39
  python inference/app.py
40
  ```
41
 
42
+ ### Sample Usage (Text-to-Image Generation)
43
+
44
+ ```python
45
+ from inference_solver import FlexARInferenceSolver
46
+ from PIL import Image
47
+
48
+ # ******************** Image Generation ********************
49
+ inference_solver = FlexARInferenceSolver(
50
+ model_path="Alpha-VLLM/Lumina-mGPT-7B-768",
51
+ precision="bf16",
52
+ target_size=768,
53
+ )
54
+
55
+ q1 = f"Generate an image of 768x768 according to the following prompt:
56
+ "
57
+ f"Image of a dog playing water, and a waterfall is in the background."
58
+
59
+ # generated: tuple of (generated response, list of generated images)
60
+ generated = inference_solver.generate(
61
+ images=[],
62
+ qas=[[q1, None]],
63
+ max_gen_len=8192,
64
+ temperature=1.0,
65
+ logits_processor=inference_solver.create_logits_processor(cfg=4.0, image_top_k=2000),
66
+ )
67
+
68
+ a1, new_image = generated[0], generated[1][0]
69
+ ```
70
+
71
+ ## Citation
72
  If you find this project useful for your research, please consider citing our papers:
73
  ```bibtex
74
  @inproceedings{huang2024realcustom,